Tag: ios

iOS: Mirror content on screen

I would like to know if it is possible to flip the contents of a UIView within the same device; meaning not to an external monitor but on the device itself. I have searched a bit on google, but all I can find is to external screens.

How to represent money in Objective-C / iOS?

I’m working on an iPhone app and want to represent money ($) amounts. I can’t use float because they introduce certain amount of rounding errors. What can I use? I’m thinking of defining my own Money class and store dollars and pennies as NSInteger internally. @interface Money : NSObject { //$10.25 is stored as dollas=10 […]

MFMailComposeViewController dismisses right away

The situation is the MFMailComposeViewController was going to be presented. I saw it was presented half-way done, but then it got dismissed. This is the error: _serviceViewControllerReady:error: Error Domain=_UIViewServiceInterfaceErrorDomain Code=3 “The operation couldn’t be completed. (_UIViewServiceInterfaceErrorDomain error 3.)” This is my source code to present the MFMailComposeViewController: -(void) MailExecute { if ([MFMailComposeViewController canSendMail]) { MFMailComposeViewController […]

How to limit the result count of NSFetchRequest?

I want to have a feature of “Recent 20 Items” in my iOS app. I use Core Data and NSFetchRequest. How can I limit the result number to 20 to achieve this? Thank you in advance! Kai.

How can i fetch value from Json response in Objective -C

I have a problem with fetching data from Json response. Here is an example data structure : ( { AT = “<null>”; DId = 0; DO = 0; PLId = 33997; PdCatList = ( { PLId = 33997; PPCId = 0; pdList = ( { IsDis = 0; IsPS = 0; IsT = 1; PA […]

how to get server response and if server response is “Success” after show alert by JSON using objective c

NSString *data = [NSString stringWithFormat:@”username=%@&password=%@”,usertxt.text,pwdtxt.text,[NSNumber numberWithBool:YES]]; NSData *postData = [data dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES]; NSString *postLength = [NSString stringWithFormat:@”%d”, [postData length]]; // preaparing URL request to send data. NSMutableURLRequest *request = [[NSMutableURLRequest alloc] init] ; connection=[[NSURLConnection alloc] initWithRequest:request delegate:self]; NSString *url = [NSString stringWithFormat:URL_PATH]; [request setURL:[NSURL URLWithString:url]]; [request setHTTPMethod:@”POST”]; [request setValue:postLength forHTTPHeaderField:@”Accept”]; [request setHTTPBody:postData]; [request setTimeoutInterval:7.0]; NSURLResponse […]

Display spiderfy leaflet annotation MKMapView

I want to show 100 map points using MKMapView on same lat longs. Please see the link. Same thing i want in iphone.

Finding the position of a button. CGRectMake

I have a button and I’m using CGRectMake to position it like this: btn5.frame = CGRectMake(211, 280, 109, 60); I guess 211 and 280 are the coordinates of the button. So how can I modify that code if I want the button to be near the bottom left corner.

How to pass the NSString from One UIViewController to Another UIViewController?

Possible Duplicate: iOS – Passing variable to view controller I have two Viewcontrollers (ViewController1 and ViewController2) , And i want to pass a String value along with a IBAction from ViewController1 to ViewController2. I am trying to read the NSString (*check) value in ViewController2’s ViewDidLoad method, but it’s returning a null value. Help me out […]

How to pass data from one view to another view in iphone

This question already has an answer here: How do I pass variables between view controllers? 6 answers iPhone: How to Pass Data Between Several Viewcontrollers in a Tabbar App 3 answers