iphone - What causes this Objective-C compile error: Stray '\235' in Program -
#import "instatwitviewcontroller.h" @implementation instatwitviewcontroller - (nsinteger)numberofcomponentsinpickerview:(uipickerview *) pickerview { return 2; } - (nsinteger)pickerview:(uipickerview *) pickerviewnumberofrowsincomponent :(nsinteger)component { if (component == 0) return [activities count]; else return [feelings count]; } /* // designated initializer. override perform setup required before view loaded. - (id)initwithnibname:(nsstring *)nibnameornil bundle:(nsbundle *)nibbundleornil { if ((self = [super initwithnibname:nibnameornil bundle:nibbundleornil])) { // custom initialization } return self; } */ /* // implement loadview create view hierarchy programmatically, without using nib. - (void)loadview { } */ // implement viewdidload additional setup after loading view, typically nib. - (void)viewdidload { [super viewdidload]; activities = [[nsarray alloc] initwithobjects:@”sleeping”, @”eating”, @”working”, @”thinking”, @”crying”, @”begging”, @”leaving”, @”shopping”, @”hello worlding”, nil]; feelings = [[nsarray alloc] initwithobjects:@”awesome”, @”sad”, @”happy”, @”ambivalent”, @”nauseous”, @”psyched”, @”confused”, @”hopeful”, @”anxious”, nil]; } /* // override allow orientations other default portrait orientation. - (bool)shouldautorotatetointerfaceorientation:(uiinterfaceorientation)interfaceorientation { // return yes supported orientations return (interfaceorientation == uiinterfaceorientationportrait); } */ - (void)didreceivememorywarning { // releases view if doesn't have superview. [super didreceivememorywarning]; // release cached data, images, etc aren't in use. } - (nsstring *)pickerview:(uipickerview *)pickerview titleforrow:(nsinteger)row forcomponent:(nsinteger)component { switch (component) { case 0: return [activities objectatindex:row]; case 1: return [feelings objectatindex:row]; } return nil; } - (void)viewdidunload { // release retained subviews of main view. // e.g. self.myoutlet = nil; } - (void)dealloc { [activities release]; [feelings release]; [super dealloc]; } @end
i following erros
stray '\235' in program - , 100 more different numbers missing sentinel function call incomplete implementation of class instatwitviewcontroller
any help, doing tutorial book, copied exactly, , don't see whats wrong
your code contains smart quotes. need straight quotes.
lines this:
activities = [[nsarray alloc] initwithobjects:@”sleeping”, @”eating”, @”working”, @”thinking”, @”crying”, @”begging”, @”leaving”, @”shopping”, @”hello worlding”, nil];
need be:
activities = [[nsarray alloc] initwithobjects:@"sleeping", @"eating", @"working", @"thinking", @"crying", @"begging", @"leaving", @"shopping", @"hello worlding", nil];
Comments
Post a Comment