Pra*_*rad 1 iphone objective-c nsarray ibaction ios
所以,我正在尝试在我的iPhone应用程序中运行此代码,但应用程序仍在崩溃.有解决方案吗
- (IBAction)logOutBtnDown:(id)sender {
[PFUser logOut];
NSArray *quotes;
int r;
quotes = [NSArray arrayWithObjects:
@"R u done yet",
@"Log in again",
@"Try Me",
@"SMD",
@"We can do this all day",
@"IDC your eating up ur RAM",
"Please just connect to the servers",
@"You are not giving up are u",
@"Forget it I quit",
@"Imma tell TDK",
nil];
r = arc4random() % 10;
[_welcomeLabel setText:[NSString stringWithFormat:@" %@", [quotes objectAtIndex: r]]];
}
Run Code Online (Sandbox Code Playgroud)
Mas*_*oke 10
错过放置@,同时添加对象..
试试这个......
- (IBAction)logOutBtnDown:(id)sender {
[PFUser logOut];
NSArray *quotes;
int r;
quotes = [NSArray arrayWithObjects: @"R u done yet", @"Log in again", @"Try Me", @"SMD", @"We can do this all day", @"IDC your eating up ur RAM", @"Please just connect to the servers", @"You are not giving up are u", @"Forget it I quit", @"Imma tell TDK", nil];
r = arc4random() % 10;
[_welcomeLabel setText:[NSString stringWithFormat:@" %@", [quotes objectAtIndex: r]]];
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
180 次 |
| 最近记录: |