Я получаю предупреждение. Аргумент в выражении сообщения является неинициализированным значением в жирной строке ниже:
***SHKActionSheet *as = [[SHKActionSheet alloc] initWithTitle:SHKLocalizedString(@"Share")***
delegate:as
cancelButtonTitle:nil
destructiveButtonTitle:nil
otherButtonTitles:nil];
as.item = [[[SHKItem alloc] init] autorelease];
as.item.shareType = type;
Есть идеи, что не так или как я могу это исправить?
P.S. - это в ShareKit
Спасибо!
Edit1: То есть вы говорите это сделать?
+ (SHKActionSheet *)actionSheetForType:(SHKShareType)type
{
SHKItem *myItem = [SHKItem text:@"Share"]; // See SHKItem for other convenience constructors for URL, image, text and file item types.
SHKActionSheet *as = [SHKActionSheet actionSheetForItem:myItem];
as.item.shareType = type;
as.sharers = [NSMutableArray arrayWithCapacity:0];
NSArray *favoriteSharers = [SHK favoriteSharersForType:type];
// Add buttons for each favorite sharer
id class;
for(NSString *sharerId in favoriteSharers)
{
class = NSClassFromString(sharerId);
if ([class canShare])
{
[as addButtonWithTitle: [class sharerTitle] ];
[as.sharers addObject:sharerId];
}
}
// Add More button
[as addButtonWithTitle:SHKLocalizedString(@"More...")];
// Add Cancel button
[as addButtonWithTitle:SHKLocalizedString(@"Cancel")];
as.cancelButtonIndex = as.numberOfButtons -1;
return [as autorelease];
}
Edit2:
+ (SHKActionSheet *)actionSheetForType:(SHKShareType)type
{
SHKActionSheet *as = [[SHKActionSheet alloc] initWithTitle:SHKLocalizedString(@"Share")
delegate:nil
cancelButtonTitle:nil
destructiveButtonTitle:nil
otherButtonTitles:nil];
as.item = [[[SHKItem alloc] init] autorelease];
as.delegate = self;
as.item.shareType = type;
as.sharers = [NSMutableArray arrayWithCapacity:0];
NSArray *favoriteSharers = [SHK favoriteSharersForType:type];
// Add buttons for each favorite sharer
id class;
for(NSString *sharerId in favoriteSharers)
{
class = NSClassFromString(sharerId);
if ([class canShare])
{
[as addButtonWithTitle: [class sharerTitle] ];
[as.sharers addObject:sharerId];
}
}
// Add More button
[as addButtonWithTitle:SHKLocalizedString(@"More...")];
// Add Cancel button
[as addButtonWithTitle:SHKLocalizedString(@"Cancel")];
as.cancelButtonIndex = as.numberOfButtons -1;
return [as autorelease];
}