views:

48

answers:

1

Alright. So I asked a question here but I feared that I anwsered it myself and closed the dicussion. No Idea if I did that. That question is available here; http://stackoverflow.com/questions/3411650/is-it-me-or-xcode-somethings-wrong-with-my-braces-and-it-just-causes-errors-p

let me go ahead with my code that gives the expected ; and unary minus (which goes away if -(VOID) is removed but then that causes another error)

its here if you need the full code its at the earlier link

  //Register for notifications;
  [[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge |UIRemoteNotificationTypeSound |UIRemoteNotificationTypeAlert)]; 
  ;

- (void)application:(UIApplication *)app didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {  
 //ERROR HERE Wrong type argument to unary minus and semi colon b4 

And I cant close the method after Register because then the lower references of DeviceToken have no organized structure

+1  A: 

I don't understand. I think the answer in your previous question is correct. Just close the method with a closing bracket } . What do you mean by "lower references of DeviceToken". I don't get it

vodkhang
Okay See the code that goes.... it says Request for deviceToken is something not a structure or union then _deviceToken undeclared first use and repeat with application undeclared etc
Sum
self.deviceToken = [[[[_deviceToken description] stringByReplacingOccurrencesOfString:@"<"withString:@""] stringByReplacingOccurrencesOfString:@">" withString:@""] stringByReplacingOccurrencesOfString: @" " withString: @""]; NSLog(@"Device Token: %@", self.deviceToken);
Sum
Where is your self.deviceToken, where is the property and synthesize of it? Did you declare them?
vodkhang
I even don't see any @synthesize deviceToken, that explains me anything about why XCode doesn't see your self.deviceToken
vodkhang
Okay I havent declared them. Where do i do this again ..
Sum
Look for something like window and viewController in the .h file and then try to do the same. @synthesize window; @synthesize viewController;
vodkhang
I know that. But I still get the errors. Where do I put the properties... in the properties nonatomic but what do I tag them asProp (nonatomic) ?????? DeviceToken
Sum
like this @property (nonatomic, retain) NSData deviceToken *deviceToken;ahh. Im stuck on such a simple issue.
Sum
You just need this.@property (nonatomic, retain) NSData *deviceTokenAnd don't forget @synthesize
vodkhang
No Declaration of deviceToken found i added syth deviceTocken and the property
Sum
I got it! In your header file:NSString *deviceToken;…..@property (nonatomic, retain) NSString *deviceToken;Can you explain why I am getting more errors like ASIHTTP undeclared expected ( before ASHTTP...
Sum
Excuse me, but I don't understand your errors
vodkhang
Me Neither. I just fail at declarations and need to hit the books again!
Sum