iphone
Get text of button from IBAction – iPhone
The sender should be the control which initiated the action. However, you should not assume its type and should instead leave it defined as an id. Instead, check for the object’s class in the actual method as follows: – (IBAction)onClick1:(id)sender { // Make sure it’s a UIButton if (![sender isKindOfClass:[UIButton class]]) return; NSString *title = … Read more
Get last path part from NSString
You can also use NSString *sub = [@”http://www.abc.com/news/read/welcome-new-gig/03276″ lastPathComponent];
How to get current orientation of device programmatically in iOS 6?
You can try this, may help you out: How to change the device orientation programmatically in iOS 6 OR Objective-c: UIDeviceOrientation orientation = [[UIDevice currentDevice] orientation] Swift: if UIDevice.current.orientation.isLandscape { // Landscape mode } else { // Portrait mode }
Has anyone had success using custom otf fonts on the iPhone?
For my own project I wanted to use the opentype font and I basically used this method: Add your custom font file into your project using XCode as a resource Add a key to your info.plist file (Fonts provided by application) For each font you have, enter the full name of your font file (including … Read more
build rules for xcode / iPhone
Assuming you’re using Xcode 4, it’s likely that the dependency checker is confused because there are .h files in list of C files to be compiled. So…. Navigate to your target’s “Build Phases” tab. (Click on the project, then click on the target’s name, then click on the “Build Phases” tab.) Ensure that you didn’t … Read more
iPhone – How set uinavigationbar height?
Create a UINavigationBar Category with a custom sizeThatFits. @implementation UINavigationBar (customNav) – (CGSize)sizeThatFits:(CGSize)size { CGSize newSize = CGSizeMake(self.frame.size.width,70); return newSize; } @end