When the picker loads the image, it wraps it into a uiimageview
Uipickerviewdatasource,uipickerviewdelegate
-(Nsinteger) Numberofcomponentsinpickerview: (uipickerview*) Pickerview;
-(Nsinteger) Pickerview: (uipickerview*) Pickerview numberofrowsincomponent: (nsinteger) component;
(required) elements in the picker
String-(nsstring*) Pickerview: (uipickerview*) Pickerview
Titleforrow: (Nsinteger) row
Forcomponent: (Nsinteger) component;
Image-(uiview*) Pickerview: (uipickerview*) Pickerview
Viewforrow: (Nsinteger) row
Forcomponent: (Nsinteger) component;
When the picker has two components (that is, there are two boxes) and the contents of the right border are transformed with the contents of the left border, the implementation
-(void) Pickerview: (uipickerview*) Pickerview
Didselectrow: (Nsinteger) row
Incomponent: (Nsinteger) component;
If you want to resize a two component,
-(CGFloat) Pickerview: (uipickerview*) Pickerview widthforcomponent: (nsinteger) component;
Note: The DataSource and delegate in the attribute that are required to configure Pickerview in IB are connected to file's Owner
Uipickerview method:-(Nsinteger) selectedrowincomponent: (int);
Find the path and load it in
NSBundle *bundle=[nsbundle Mainbundle];
NSString *path=[bundle pathforresource:@ "file name" oftype:@ "extension"];
Nsdictionary *d=[[nsdictionary Alloc]initwithcontentsoffile:path];
Sort arrays
Nsarray *array;
Nsarray *sorted=[array sortedarrayusingselector: @selector (compare:)];
Get all the keys to the dictionary
Nsarray *arr=[dictionary AllKeys];
Select specific component-specific lines for the picker and animate them
[Picker Selectedrow:row incomponent:component Animated:yes];
[Picker reloadcomponent:component];
Image Import
UIImage *image=[uiimage imagename:@ "all filenames"];
Uiimageview *imageview=[[uiimageview Alloc]initwithname:image];
Key-value pairs
[Self setvalue:nsobject* forkey:@ "..."];
Random number generation
int i=random ()%n;
Video Audio Import
#import <AudioToolbox/AudioToobox.h>
First: Remember to join the framework
NSString *path=[[nsbundle mainbundle]pathforresource:@ "file name" oftype:@ "extension"];
Systemsoundid Soundid;
Audioservicescreatesystemsoundid ((cfurlref) [Nsurl Filewithpath:path],&soundid);
Audioservicesplaysystemsound (Soundid);
Custom Call Method functions
[Self performselector: @selector (name of function) Withobject:nil Afterdelay: Time];