저는이 기능에 익숙하지 않지만 iOS 시뮬레이터에서 시뮬레이션을 시도하면 멈추고이 오류가 나타납니다. 내 스토리 보드에서 내 테이블보기. 나는 당신이 저를 도울 충분한 정보가 있도록 파일을 포함시킬 것입니다.시뮬레이터에서 실행 중일 때 "스레드 1 : 신호 SIGARBT"오류
Im 테이블보기로 배열의 일부 요소를 표시하려고합니다. 네비게이션 컨트롤러는 루트보기 컨트롤러이며 바로 배열보기를 표시하려는 테이블보기 컨트롤러로 이동합니다. 여기
여기//AppDeligate.m
#import "AppDelegate.h"
#import "CoursesViewController.h"
#import "Courses.h"
@implementation AppDelegate{
NSMutableArray *courses;}
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions
(NSDictionary *)launchOptions
{
courses = [NSMutableArray arrayWithCapacity:20];
Courses *course = [[Courses alloc] init];
course.code = @"SFWR 3X03";
course.units = 3;
[courses addObject:course];
UINavigationController *navigationController =
(UINavigationController *)self.window.rootViewController;
CoursesViewController *CoursesViewController =
[[navigationController viewControllers] objectAtIndex:1];
CoursesViewController.courses = courses;
return YES;
}
내 CoursesViewController.m 여기
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
#warning Potentially incomplete method implementation.
// Return the number of sections.
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
#warning Incomplete method implementation.
// Return the number of rows in the section.
return [self.courses count];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath
*)indexPath
{
UITableViewCell *cell = [tableView
dequeueReusableCellWithIdentifier:@"PlayerCell"];
Courses *course = [self.courses objectAtIndex:indexPath.row];
cell.textLabel.text = course.code;
return cell;
}
입니다 deligate 내 응용 프로그램입니다 나의 coursesviewcontroller.h 여기
#import <UIKit/UIKit.h>
@interface CoursesViewController : UITableViewController
@property (nonatomic, strong) NSMutableArray *courses;
@end
입니다 내 courses.m 및 과정 .h
#import "Courses.h"
@implementation Courses
@synthesize code;
@synthesize units;
.
#import <Foundation/Foundation.h>
@interface Courses : NSObject
@property (nonatomic, copy) NSString *code;
@property (nonatomic, assign) int units;
@end
@end
내가 시뮬레이터에서 실행하려고, 내가 포함 havent 한 경우 충분한 정보가 병 후 더 알려과 main.m 파일을 뒤집 및 스레드 1
에 SIGARBT 오류를 표시합니다 .
는콘솔 출력 : 당신은 스토리 보드를 사용하고 있기 때문에
2012-10-04 14:44:14.726 MacMarks[475:c07] *** Terminating app due to uncaught exception
'NSInternalInconsistencyException', reason: '-[UITableViewController loadView] loaded the
"fBI-R0-7j9-view-iYf-OA-4cJ" nib but didn't get a UITableView.'
*** First throw call stack:
(0x1c8e012 0x10cbe7e 0x1c8ddeb 0x242417 0xf4648 0xf4882 0xf4b2a 0x10bef5 0x10bfdb 0x10c286
0x10c381 0x10ceab 0x10cfc9 0x10d055 0x2123ab 0x6392d 0x10df6b0 0x228afc0 0x227f33c
0x228aeaf 0x1028cd 0x4b1a6 0x49cbf 0x49bd9 0x48e34 0x48c6e 0x49a29 0x4c922 0xf6fec 0x43bc4
0x43dbf 0x43f55 0x4cf67 0x10fcc 0x11fab 0x23315 0x2424b 0x15cf8 0x1be9df9 0x1be9ad0
0x1c03bf5 0x1c03962 0x1c34bb6 0x1c33f44 0x1c33e1b 0x117da 0x1365c 0x22fd 0x2225)
libc++abi.dylib: terminate called throwing an exception
(lldb)
Xcode에서 콘솔의 출력은 무엇입니까? – sergio
2012-10-04 12 : 33 : 15.917 MacMarks [270 : c07] 캐치되지 않은 예외 'NSRangeException'로 인해 앱 종료 중, 이유 : '*** - [NSArrayI objectAtIndex :] : 인덱스 1이 경계를 벗어남 [0. . 0] ' *** 먼저 던져 호출 스택 : (0x1c8e012 0x10cbe7e 0x1c43b44 0x2502 0x107b7 0x10da7 0x11fab 0x23315 0x2424b 0x15cf8 0x1be9df9 0x1be9ad0 0x1c03bf5 0x1c03962 0x1c34bb6 0x1c33f44 0x1c33e1b 0x117da 0x1365c 0x22fd 0x2225) 의 libC++ ABI.dylib : 예외 던지기라는 종료 (0120) (lldb) – drfear
조금 도와 줘요. 나는 아직도 당신이 생각하는 것을 듣고 싶습니다. :) – drfear