아바타의 원격 이미지를로드하려고하면 내 이미지를 사용할 수 없다는 오류 메시지와 함께 응용 프로그램이 다운됩니다. 단순히 앱이 성공 로그에 도착하기 전에 충돌한다원격 이미지로드 중 JSQMessagesAvatarImageFactory가 깨졌습니다.
- (void)viewDidLoad {
[super viewDidLoad];
self.inputToolbar.contentView.textView.pasteDelegate = self;
self.userAvatarDictionary = [[NSMutableDictionary alloc] init];
self.latestGuid = @"";
/**
* Load up our fake data for the demo
*/
self.demoData = [[DemoModelData alloc] init];
/**
* You can set custom avatar sizes
*/
self.collectionView.collectionViewLayout.incomingAvatarViewSize = CGSizeMake(30, 30);
self.collectionView.collectionViewLayout.outgoingAvatarViewSize = CGSizeZero;
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage jsq_defaultTypingIndicatorImage]
style:UIBarButtonItemStylePlain
target:self
action:@selector(receiveMessagePressed:)];
//Load remote image for Gibson Les Paul Guitar as test
NSString *imgURLString = @"http://images.gibson.com/Products/Electric-Guitars/Les-Paul/Gibson-USA/Les-Paul-Studio/Splash-02.jpg";
NSURL *url = [NSURL URLWithString:imgURLString];
NSLog(@"CREATED USER ID: 13");
NSLog(@"CREATOR IMAGE URL: %@", imgURLString);
NSData *data = [NSData dataWithContentsOfURL:url];
UIImage *dataLoadedImg = [UIImage imageWithData:data];
JSQMessagesAvatarImage *img = [JSQMessagesAvatarImageFactory avatarImageWithImage:dataLoadedImg diameter:20.0f];
[self.userAvatarDictionary setObject:img forKey:@"13"];
NSLog(@"ADDED GIBSON ICON SUCCESSFULLY");
[self callViewMessagesListWithLatestMessageGuid:self.latestGuid
CompletionBlock:^(NSMutableArray *resultsArray) {
[self reloadData:resultsArray];
}];
[NSTimer scheduledTimerWithTimeInterval:15.0 target:self selector:@selector(fifteenSecondsPassed:) userInfo:nil repeats:YES];
}
를 당분간 내있는 viewDidLoad 방법에 아바타 생성을 추가하고, 분명히 메시지 로딩 웹 서비스 호출 받고 있지 않습니다.
Logging/Error messaging:
CREATED USER ID: 13
CREATOR IMAGE URL: http://images.gibson.com/Products/Electric-Guitars/Les-Paul/Gibson-USA/Les-Paul-Studio/Splash-02.jpg
*** Assertion failure in +[JSQMessagesAvatarImageFactory jsq_circularImage:withDiameter:highlightedColor:], /Users/propstm/Documents/Github/MyProject/Pods/JSQMessagesViewController/JSQMessagesViewController/Factories/JSQMessagesAvatarImageFactory.m:132
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid parameter not satisfying: image != nil'