QQ Group in the collection of foreign enterprise iOS development Pen questions

Source: Internet
Author: User

A group of foreign-funded iOS development pen questions, can you answer it? Collected from the group.

1 Why can ' t nsarray contain Nsinteger Instance? With which extra step can do it?
2.complete This code so the it becomes syntacticallty correct using no more than one additional word and square brancket s Nsinteger [email protected] "10000";

This I will answer is:

Nsinteger myInt = [myString intvalue];

3.What does the following code do? Variable age is defined as Nsinteger It compiles fine. But why does it crash? UILabel *mylabel=[uilabel New]; Mylabel.text=age? [NSString stringwithformat:@ "%@", age];@ "";

My answer is: Define a Uitable object that assigns a value to the object's Text property based on the true or false of age. Is the crash caused when BOOL is converted to string?
4.Why does the following code crash as soon as the property is set? What's the simple fix? MeasueStripView.h @Interface Measuelinealview:uiview {Nsuiinteger minvalue;
} @property (nonatomic,assign) Nsuiinteger MinValue;
MEASUESTRIPVIEW.M #import "MeasueStripView.h" @implementation measuestripview @synthsize minvalue #progma Mark Passthrough Properties-(void) Setminvalue: (Nsuiinteger) Aval {
Self.minvalue:aVal; } Some other File:measuestripview *myms=[measuestripview ww], Myms.minvalue=100;//this line crashes.
5.You has a UIView and would like-to-it to has rounded corners, what's the fastest to achive that|
6 How many methods does you know the performing a piece of code in other thread on IOS4.0 and later version.

On the issue of multithreading, you can only go through Apple's documents.

I found the method is: 1, detachnewthreadselector or Performselectorinbackground 2, Nsthread 3, Nsoperationqueue

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.