Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/43.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone 是什么导致此Objective-C编译错误:流浪'\235';节目中_Iphone_Objective C - Fatal编程技术网

Iphone 是什么导致此Objective-C编译错误:流浪'\235';节目中

Iphone 是什么导致此Objective-C编译错误:流浪'\235';节目中,iphone,objective-c,Iphone,Objective C,我得到以下错误 程序中的游离'\235' -还有100多个不同的数字 缺少sentinel函数调用 InstatwitViewController类的实现不完整 任何帮助,只要从一本书上做一个教程,完全复制,并且看不出有什么错误您的代码包含智能引用。它们必须是直接引用 像这样的台词: #import "InstatwitViewController.h" @implementation InstatwitViewController - (NSInteger)numberOfCompone

我得到以下错误

程序中的游离'\235' -还有100多个不同的数字 缺少sentinel函数调用 InstatwitViewController类的实现不完整


任何帮助,只要从一本书上做一个教程,完全复制,并且看不出有什么错误

您的代码包含智能引用。它们必须是直接引用

像这样的台词:

#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]; 
}

/*
// The designated initializer. Override to perform setup that is required before the view is loaded.
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
    if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) {
        // Custom initialization
    }
    return self;
}
*/

/*
// Implement loadView to create a view hierarchy programmatically, without using a nib.
- (void)loadView {
}
*/



// Implement viewDidLoad to do additional setup after loading the view, typically from a 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 to allow orientations other than the default portrait orientation.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    // Return YES for supported orientations
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
*/

- (void)didReceiveMemoryWarning {
 // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];

 // Release any cached data, images, etc that 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 any retained subviews of the main view.
 // e.g. self.myOutlet = nil;
}


- (void)dealloc {
    [activities release]; 
 [feelings release]; 
 [super dealloc];
}

@end
需要:

activities = [[NSArray alloc] initWithObjects:@”sleeping”, @”eating”, @”working”, @”thinking”, @”crying”, 
    @”begging”, @”leaving”, @”shopping”, @”hello worlding”, nil];

该错误可能是由于准确复制了
而导致的。这意味着您的代码中至少有一个字符是编译器无法解析的。

是的,它也咬了我几次。(主要是关于shell脚本技巧,这些技巧通常是由不经常写代码的人写的。)
activities = [[NSArray alloc] initWithObjects:@"sleeping", @"eating", @"working", @"thinking", @"crying", 
    @"begging", @"leaving", @"shopping", @"hello worlding", nil];