Skip to content
This repository

userLoginWithUsername won't compile in xcode #51

Closed
doctorDrupal opened this Issue August 19, 2012 · 2 comments

2 participants

doctorDrupal Kyle Browning
doctorDrupal

Hello--I realize that I'm likely asking a newbie question. Hopefully, you guys will remember what it was like to start out and provide some guidance. As a bit of background, I've built my Drupal 6 site and am now trying to build an iOS app so that users can login and see their info using the views I've created. I've built my app framework and am now working on the ability to login from within the app. I am using Xcode (obviously), Drupal-iOS-SDK, and AFNetworking. I have added the following code to my ViewController.m file:

  • (IBAction)login:(id)sender { DIOSUser *user = [[DIOSUser alloc] init]; [user userLoginWithUsername:@"userName" andPassword:@"password"]; //this line won't compile }

Unfortunately, the line commented above won't compile--I keep getting the error message, "No visible @interface for DIOSUser declares the selector 'userLoginWithUsername:andPassword:'. I have imported "DIOSUser.h" and the line above the problematic line compiles just fine. Additionally, I have checked DIOSUser.h and DIOSUser.m to make sure the 'userLoginWithUsername..." method is declared.

DIOSUser.h:

  • (void)userLoginWithUsername:(NSString *)username andPassword:(NSString *)password success:(void (^)(AFHTTPRequestOperation *operation, id responseObject)) success failure:(void (^)(AFHTTPRequestOperation *operation, NSError *error)) failure;

DIOSUser.m:

  • (void)userLogin:(NSDictionary *)user success:(void (^)(AFHTTPRequestOperation *operation, id responseObject)) success failure:(void (^)(AFHTTPRequestOperation *operation, NSError *error)) failure { [self userLoginWithUsername:[user objectForKey:@"name"] andPassword:[user objectForKey:@"pass"] success:success failure:failure]; }

Again, I realize that this might be an elementary question but everybody has to start somewhere. I thank you in advance for your help. Take care and have a great day!

Sincerely,

DoctorDrupal

Kyle Browning

The problem you are having is that these are class public methods.

You dont instatiate objects anymore.

This answer should help you, http://stackoverflow.com/questions/1053592/objective-c-class-vs-instance-methods

Kyle Browning kylebrowning closed this September 04, 2012
doctorDrupal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.