UIPickerview in iphone - iphone-sdk-3.0

How to reduce the size of UIPickerview in a subView? I am reducing the CGRectMake(120, 20, 60,25). But it appears in the normal size. What i do now?
Some One help me.
Thanks in Advance.

Use the delegate method below
- (CGFloat)pickerView:(UIPickerView *)pickerView widthForComponent:(NSInteger)component
This will resolve the issue.You can also refer the same from apple documentation.
Cheers
Aditya

Related

How to create an "image picker" in Objective-C

guys. I am a newbie at Objective-C programming. I was wondering if it is possible to make an image that a user can pick from an image library on their phone. I already have created a UIImageView in the storyboard and a UIImage in the code. How should I do this? Thanks in advance.
Yes, have a look at the UIImagePickerController class and set the source type to UIImagePickerControllerSourceTypePhotoLibrary

How to handle orientation delegate method in IOS6, IOS7 and IOS 8?

I am working on the new iphone app and I have to give orientation support in all IOS version(ios 6 and later). can anybody explain what is the best way to handle orientation for all IOS versions.
I searched and found that few of older version delegate methods have been deprecated in the newer version of IOS.
How should I manage of this?
Please provide idea.
Thanks In advance.
In iOS7 & iOS8 you can use auto layout and size classes when you create a new project a
600x600 resolution ViewController is added you have to add constraints on that ViewController then it will run same on all devices
For auto layout you can follow these tutorials
1-[http://www.raywenderlich.com/83276/beginning-adaptive-layout-tutorial][1]
2-[http://www.appcoda.com/introduction-auto-layout/][2]
3-[http://www.brianjcoleman.com/autolayout-xcode6/][3]
Even it will run on iPads too.
thanks
I think those three methods can meet your requirement.
- (BOOL)shouldAutorotate NS_AVAILABLE_IOS(6_0);
- (NSUInteger)supportedInterfaceOrientations NS_AVAILABLE_IOS(6_0);
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation NS_AVAILABLE_IOS(6_0);

NSImageView setImage causing NSView not correctly initialized

I'm writing a networking program which sends an image from an iPhone to a Mac. I have the connection going fine, and passing data alright, but my problem is when I have the image sent over I try to display it and get the following warning:
NSImageView(0x101321fd0) - NSView not correctly initialized. Did you
forget to call super?
Here is the code, it's the "setImage" command throwing the error.
This is my first major venture into Objective-C, I'm worried I messed up something with the xib but I can't be sure.
imageView = [NSImageView alloc];
[imageView setImage:theImage];
NSLog(#"Should be able to see image now..");
If this is too vague for a direct answer then any tips, references or tutorials you can guide me to would be very welcome.
Thanks for your time.
You forget to init the imageView.
imageView = [[NSImageView alloc] initWithFrame:someFrame]

xcode: get y-position of uibutton

I know that's quite an easy one but I haven't found anything about it.
All I want is how I can get the y-position of a unbutton?
I hope that anyone can help.
Thanks in advance.
Since UIButton is a subclass of UIView you can simply use
button.frame.origin.y
Or you can use a more flexible way
CGRectGetMinY(button.frame)
for example you can get the mid Y pos like this
CGRectGetMidY(button.frame)

Display NSArray on window IB

I have an application that reads/parses data into a file and store it into a NSMutableArray.
I need to display the contents (data) of this array into a window (tableview or else don't care) the only problem is that the data is not static so i can't fix n labels if you understand me.
If someone can help me
Thanks to all
This is for solve such problems that Apple design the UITableViewDelegate protocol
Follow the documentation and you should solve your problem.
This is a job for Cocoa Bindings.