Question: I'm working on dokuwiki plugin and I've found interesting think about how js stores element id. I'm not sure what is going on... So I have a code from dokuwiki linkwiz.js file which is using to determine if ':' char is in the part of the id string:

```
    dw_linkwiz.textArea = $editor[0];

//some code between

    // prepend colon inside namespaces for non namespace pages
    if(dw_linkwiz.textArea.form.id.value.indexOf(':') != -1 &&
       link.indexOf(':') == -1){
       link = ':' + link;
    }

```

the $editor is the jQuery object. As you can see to get id of the element they uses form.id.value but in some cases when I setting id of the element dynamicly using jQuery .attr method, the form.id.value is undefined and the id string is simply kept in form.id . Do you know why it happes? Which is more standard compilant?

Answer: 
You need to set the `preferredMaxLayoutWidth` of the label, to your fixed width. I don't know why it can't figure this out for itself since you've constrained to a width, but there you go. 

If having to set a fixed size feels wrong in an Autolayout world (which it should!) then you can set the value from the label's width *after* layout has occurred, in viewDidLayoutSubviews. Be careful not to get into an infinite loop of invalidating your layout in this case.
Try This code it may helpful to You>

```
   label.text=@"haiiiiiiiii";

    UIFont *cellFont=[UIFont fontWithName:@"Helvetica" size:12.0];
    CGSize constraintSize=CGSizeMake(250,MAXFLOAT);
    CGSize txtViewSize=[label.text sizeWithFont:cellFont constrainedToSize:constraintSize lineBreakMode:UILineBreakModeWordWrap];

```

yourlabelname.numberOfLines=0;

CGRect frame=yourlabelname.frame;

```
frame.size.width=250;

frame.size.height=txtViewSize.height;

yourlabelname.frame=frame;

yourlabelname.text=cellText;

```