-3

I Have A Problem In My App when I wrote This Code UILineBreakModeWordWrap And I Got

UILineBreakModeWordWrap deprecated : first deprecated in IOS 6 ""And Some Time IOS 7""

My Code Is :

NSString *texto = [[superArray objectAtIndex:indexPath.row]objectForKey:@"Text"];
CGSize tamanho=[texto sizeWithFont:[UIFont systemFontOfSize:16.0f]constrainedToSize:CGSizeMake(240.0f, 480.0f) lineBreakMode:UILineBreakModeWordWrap];
UIImage *imagemBalao;

And

cell.label.lineBreakMode=UILineBreakModeWordWrap;

And The Same Problem In This Code GKPeerPickerController

(void)peerPickerControllerDidCancel:(GKPeerPickerController *)picker{
    picker.delegate = nil;
}

And

(void)peerPickerController:(GKPeerPickerController *)picker didConnectPeer:(NSString *)peerID toSession:(GKSession *) session {
    currentSession = session;
    session.delegate = self;
    [session setDataReceiveHandler:self withContext:nil];
    picker.delegate = nil;
    [picker dismiss];
}

Any ideas?

4

2 回答 2

5

使用 NSLineBreakByWordWrapping 代替 UILineBreakMode。这是新枚举的列表

 enum {
        NSLineBreakByWordWrapping = 0,
        NSLineBreakByCharWrapping,
        NSLineBreakByClipping,
        NSLineBreakByTruncatingHead,
        NSLineBreakByTruncatingTail,
        NSLineBreakByTruncatingMiddle
      };
     typedef NSUInteger NSLineBreakMode
于 2013-10-17T21:56:47.963 回答
0
   NSString *texto = [[superArray objectAtIndex:indexPath.row] objectForKey:@"Text"];

    CGSize s = [texto sizeWithFont:[UIFont systemFontOfSize:16.0f] constrainedToSize:CGSizeMake(240.0f, 480.0f) lineBreakMode:NSLineBreakByWordWrapping];

另一个堆栈答案

于 2013-10-17T21:54:53.050 回答