iphone-sdk-3.0

iPhone Animated Loading Screen

爷,独闯天下 提交于 2019-12-05 00:52:26
Is there a way to have an animated loading screen for my iPhone application as opposed to the Default.png that I currently am using? In short - no. The purpose of the Default.png is to give the iPhone OS something to display to the user while it loads your application in. The best you can do is to speed up the initial load of your application (say defer your resource loading until after the program is running), then add your own animation while you actually load your resources 'behind the scenes'. If you think of it as an animated loading screen then no, but having the first view of you

UITableView slow, even with just a few objects?

﹥>﹥吖頭↗ 提交于 2019-12-04 21:20:25
- (void)viewDidLoad { [super viewDidLoad]; [self.tableView setRowHeight:100]; [self.tableView setSeparatorStyle:UITableViewCellSeparatorStyleNone]; [self.view setBackgroundColor:[UIColor groupTableViewBackgroundColor]]; } #pragma mark - #pragma mark Table view data source // Customize the number of sections in the table view. - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return 1; } // Customize the number of rows in the table view. - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return 3; } // Customize the appearance of table

Refreshing XML data and updating a UITableView

南笙酒味 提交于 2019-12-04 21:15:28
I'm developing an iPhone application which uses a TableView to display XML data. The XML data comes from an external resource and is parsed and put into an object for use as a table dataSource. The application uses a UITabBar and multiple ViewControllers all programmatically created and using the same dataSource. Everything is fine and dandy, but I'd like to implement a refresh button, so that a user can refresh the content (globally, so all the ViewControllers should be updated). The parser will query the XML again and create a new object. The problem I'm having is that I can't seem to

How to send images to a web service?

无人久伴 提交于 2019-12-04 20:23:59
Hey, can anyone post a sample code demonstrating how can images (jpeg, png) be posted on a local web service. Sayeed First google hit would probably help you. Here is a code snippet - - (void)useImage:(UIImage*)theImage { /* turning the image into a NSData object getting the image back out of the UIImageView setting the quality to 90 */ NSData *imageData = UIImageJPEGRepresentation(theImage, 90); // setting up the URL to post to NSString *urlString=[SiteUrl stringByAppendingString:@"iphone_upload_photo.php?type=colleague&token="]; urlString=[urlString stringByAppendingString:PublicToken]; //

How do I integrate popToRootViewControllerAnimated with my tabs?

北战南征 提交于 2019-12-04 19:30:18
I am trying to make one of my tab buttons go to the root using popToRootViewControllerAnimated. My question is: where do I put this code for it to work? I have my tabs created through Interface Builder... do they have to be hard coded for this to work? Here is the code that I'm looking to use: [self.navigationController popToRootViewControllerAnimated:YES]; New code in AppDelegate: - (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController { if (viewController = HomeViewController) { [HomeViewController

How to draw a triangle with QUARTZ 2D?

此生再无相见时 提交于 2019-12-04 19:09:14
I'm developing an iPhone app with 3.1.3 SDK. I'm trying to draw a triangle with transparent fill an 1px black stroke with this code: CGContextMoveToPoint(ctx, position.X, position.Y - (size.height / 2)); CGContextAddLineToPoint(ctx, position.X - (size.width / 2), position.Y + (size.height / 2)); CGContextAddLineToPoint(ctx, position.X + (size.width / 2), position.Y + (size.height / 2)); CGContextFillPath(ctx); CGContextSetLineWidth(ctx, 1.0); CGContextStrokePath(ctx); CGContextSetFillColorWithColor(ctx, [[UIColor clearColor] CGColor]); But I get a black filled triangle. What am I doing wrong?

Objective-C : UIScrollView manual paging

﹥>﹥吖頭↗ 提交于 2019-12-04 18:54:19
I want to use the scrollview as something like a picker in horizontal mode. The scrollview holds up to seven subviews. Each subview represents a value. Always three views are visible and the one in the middle is the selected one. Scrollview visible at start: __ | V1 | V2 Scrollview set to view/value two: V1 | V2 | V3 Scrollview set to last value: V2 | V3 | __ The real problem I have got is the "pagingEnabled" flag. If pagingEnabled is set to YES the scrollview pages always three subviews/values instead of only one. If pagingEnabled is set to NO the scrollview does not clinch. Is there a nice

How to detect space, and special characters like :, ?,`,~, etc in text of a textfield in iPhone SDK?

a 夏天 提交于 2019-12-04 18:10:56
How to detect space, and special characters like :, ?,`,~, etc in text of a textfield in iPhone SDK? Try this.. NSCharacterSet* symbols = [NSCharacterSet symbolCharacterSet]; if([symbols characterIsMember: yourCharacter]) { //Check Your condition here } If you want to include many characters Use a combined NSCharacterset with NSMutableCharacterSet.. NSMutableCharacterSet *space = [NSMutableCharacterSet characterSetWithCharactersInString:@" "]; [space formUnionWithCharacterSet:[NSCharacterSet symbolCharacterSet]]; Use the space characterset to check the character You could also use an instance

How to hide/disable only the first uinavigationbar?

孤人 提交于 2019-12-04 17:47:42
问题 I've been wandering how to hide / remove / disable only the main or first navigation bar in the navigation controller so that I could put an image as a whole background screen but I couldn't find any solution. Did try hide the titleview in viewdidLoad of the main navigation controller but didn't work. Tried using navigationBarHidden but it hides the whole navigation bar for the next stack of controller. So, I'm not sure how to do this. To give you an example, I would like to have something

Send image and text in email from within app

那年仲夏 提交于 2019-12-04 17:47:24
How can I send an image along with text, which is in the form of tabular data, in an email from within my app? Please help and make suggestions. Thanks. - (void)sendMailWithImage:(UIImage *)image { if([MFMailComposeViewController canSendMail]) { MFMailComposeViewController *mailController = [[MFMailComposeViewController alloc] init]; if(mailController!=nil) { mailController.mailComposeDelegate = self; NSData *imageData = UIImagePNGRepresentation(image); [mailController addAttachmentData:imageData mimeType:@"image/png" fileName:@"MyImageName"]; [mailController setSubject:yourSubject];