Search Results

Search found 19072 results on 763 pages for 'iphone sdk 4'.

Page 158/763 | < Previous Page | 154 155 156 157 158 159 160 161 162 163 164 165  | Next Page >

  • CGPath and Quartz 2D

    - by iphonedevnoob
    I want to create a triangle using Quartz 2D functions. The 3 edges of the triangle should be in different colors. I am able to create the triangle but not able to set the color of each edge or subpath separately. Any suggestions or sample code are much appreciated.

    Read the article

  • UIImage Shadow Trouble

    - by Brandon Schlenker
    I'm trying to add a small shadow to an image, much like the icon shadows in the App Store. Right now I'm using the following code to round the corners of my images. Does anyone know how I can adapt it to add a small shadow? - (UIImage *)roundCornersOfImage:(UIImage *)source height:(int)height width:(int)width { int w = width; int h = height; CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); CGContextRef imageContext = CGBitmapContextCreate(NULL, w, h, 8, 4 * w, colorSpace, kCGImageAlphaPremultipliedFirst); CGContextBeginPath(imageContext); CGRect rect = CGRectMake(0, 0, w, h); addRoundedRectToPath(imageContext, rect, 10, 10); CGContextClosePath(imageContext); CGContextClip(imageContext); CGContextDrawImage(imageContext, CGRectMake(0, 0, w, h), source.CGImage); CGImageRef imageMasked = CGBitmapContextCreateImage(imageContext); CGContextRelease(imageContext); CGColorSpaceRelease(colorSpace); return [UIImage imageWithCGImage:imageMasked]; } "addRoundedRectToPath" refers to another method that obviously rounds the corners.

    Read the article

  • Extremely slow MFMailComposeViewControllerDelegate

    - by Jeff B
    I have a bit of a strange problem. I am trying to send in-app email. I am also using Cocos2d. It works, so far as I get the mail window and I can send mail, but it is extremely slow. It seems to only accept touches every second or so. I checked the cpu usage, and it is quite low. I paused my director, so nothing else should be happening. Any ideas? I am pulling my hair out. I looked at some examples and did the following: Made my scene the mail delegate: @interface MyLayer : CCLayer <MFMailComposeViewControllerDelegate> { ... } And implemented the following function in the scenes: -(void) showEmailWindow: (id) sender { [[CCDirector sharedDirector] pause]; MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init]; picker.mailComposeDelegate = self; [picker setSubject: @"My subject here"]; NSString *emailBody = @"<h1>Here is my email!</h1>"; [picker setMessageBody:emailBody isHTML:YES]; [myMail presentModalViewController:picker animated:NO]; [picker release]; } I also implemented the mailComposeController, to handle the callback.

    Read the article

  • How to conform to UITabBarControllerDelegate

    - by 4thSpace
    I have a tabbar based application and do the following to get a reference to the application delegate: MyAppDelegate *appDelegate = [[UIApplication sharedApplication] delegate]; Which then gives this warning: warning: type 'id <UIApplicationDelegate>' does not conform to the 'UITabBarControllerDelegate' My application delegate header looks like this: #import <UIKit/UIKit.h> @interface MyAppDelegate : NSObject <UIApplicationDelegate, UITabBarControllerDelegate> { UIWindow *window; UITabBarController *tabBarController; } @property (nonatomic, retain) IBOutlet UIWindow *window; @property (nonatomic, retain) IBOutlet UITabBarController *tabBarController; @end The only methods in the .m file are applicationDidFinishLaunching and dealloc. What else do I need to conform to the protocol?

    Read the article

  • How to get the same UITableViewCell layout as in the Address Book app?

    - by Romain
    Hi, I currently have a custom UITableViewCell which contains a few labels, and an image. The "main" label is used to display people's names. Currently, I'm styling it in bold text. What I'd like to do (to gain some space and readability), is to mimic the Address Book app cell style, that is: first name in light text, and family name in bold text. Is there a way to do this using the same UILabel? Or, should I use 2 different UILabels? How should I layout them, without knowing their sizes? Thanks in advance for your assistance!

    Read the article

  • How should I load a xib into a detail view for a split view iPad objective app?

    - by editor
    I've got a split view iPad app with table view in the master pane. After drilling down several levels, each time loading a new .xib, I'd like one of the cells to trigger a web page load in the detail pane. Right now I can only get the web page .xib to load in the master pane side -- which is a master pain in my side. The basic load call where "URLWindow" is a class loaded with initWithNibName: [[self navigationController] pushViewController:URLWindow animated:YES]; I want to do this, but it doesn't seem to work: @interface @property (nonatomic, retain) IBOutlet DetailViewController *detailViewController; ... @implementation [[self detailViewController] pushViewController:URLWindow animated:YES]; How should I be loading the URLWindow .xib into a detail view for a split view detail pane?

    Read the article

  • How to troubleshoot deallocation of object in uitableview?

    - by 4thSpace
    I have a table view with tall cells. About 300 in height. The cells are custom and have an associated nib. In cellForRowAtIndexPath, I access an object in an array using indexPath.row. The object has properties, which I assign to labels on the custom cell. This works fine for the first two cells. Once I scroll enough for the third cell to get created, the app crashes. I have NSZombieEnabled set and here is the output: 2010-04-19 21:48:13.360 MyApp[54463:207] *** -[CALayer release]: message sent to deallocated instance 0xfc4e50 (gdb) continue 2010-04-19 21:48:18.382 MyApp[54463:207] *** NSInvocation: warning: object 0xfc4e50 of class '_NSZombie_CALayer' does not implement methodSignatureForSelector: -- trouble ahead 2010-04-19 21:48:18.383 MyApp[54463:207] *** NSInvocation: warning: object 0xfc4e50 of class '_NSZombie_CALayer' does not implement doesNotRecognizeSelector: -- abort (gdb) continue Program received signal: “EXC_BAD_ACCESS”. (gdb) I'm not sure what is deallocated. How can I trace this to the source?

    Read the article

  • Interchanging presentModalViewController and pushViewController

    - by Neffster
    I am using a sample ViewController that is displayed in the sample program as a presentModalViewController. However, I want to use pushViewController on the UIViewController instead. The problem is that when I switch to pushViewController, the ViewController no displays properly. Functions in the ViewController are called, but I don't see anything. I change back to presentModalViewController and everything works. The question is what do I need to do to make pushViewController work? FCVC *fcVC; NSArray *array = [[NSBundle mainBundle] loadNibNamed:@"fcVC" owner:self options:nil]; fcVC = [array objectAtIndex:0]; A. [self presentModalViewController:fcVC animated:YES]; // "WORKS" or B. [self.navigationController pushViewController:fcVC animated:YES]; // "Doesn't work

    Read the article

  • Change Sprite Anchorpoint without moving it?

    - by Oscar Gomez
    I am trying to change my Sprite anchor point so that I can rotate over a 0.0f,0.0f anchorpoint. At first my object is rotation at the default anchor point (0.5f,0.5f). However later on I need it to rotate over a 0.0,0.0 AnchorPoint. The problem is I cannot change the anchor point and change the position accordingly, so it stays on the same position, without the object appearing to quickly move and reposition to its original point. Is there a way I can set the anchor point and the position of my Sprite at once, without it moving at all?. Thank you. -Oscar

    Read the article

  • Nav Controller, UITableViewController, UITextField to become firstResponder?

    - by Daniel Granger
    I have a core data application which uses a navigation controller to drill down to a detail view and then if you edit one of the rows of data in the detail view you get taken to an Edit View for the that single line, like in Apples CoreDataBooks example! The edit view is a UITableviewController which creates its table with a single section single row and a UITextfield in the cell, programatically. What I want to happen is when you select a row to edit and the edit view is pushed onto the nav stack and the edit view is animated moving across the screen, I want the textfield to be selected as firstResponder so that the keyboard is already showing as the view moves across the screen to take position. Like in the Contacts app or in the CoreDataBooks App. I currently have the following code in my app which causes the view to load and then you see the keyboard appear (which isn't what I want, I want the keyboard to already be there) - (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; [theTextField becomeFirstResponder]; } You can't put this in -viewWillAppear as the textfield hasn't been created yet so theTextField is nil. In the CoreDataBooks App where they achieve what i want they load there tableview from a nib so they use the same code but in -viewWillAppear as the textfield has already been created! Is there anyway of getting around this without creating a nib, I want to keep the implementation programatic to enable greater flexibility. Many Thanks

    Read the article

  • UITextView insert text in the textview text

    - by John Smith
    I want to have to occasionally insert text into the UITextView text object. For example, if the user presses the "New Paragraph" button I would like to insert a double newline instead of just the standard single newline. How can I go about such? Do i have to read the string from UITextView, mutate it, and write it back? Then how would I know where the pointer was? Thanks

    Read the article

  • UINavigationController from UIViewController

    - by 4thSpace
    I currently have this workflow in a tab based app: Tab1 loads... ViewOne : UIViewController >> PickerView : UIViewController >> DetailView : UIViewController "" means loads based on user action. I'd like navigation bars on PickerView and DetailView. PickerView just needs a cancel button in the top left of its nav bar. DetailView needs the normal navbar back button. I already have PickerView's nav bar wired up through IB and working. I'm not sure what to do with PickerView's nav bar. PickerView is also loaded from Tab2, who's main view starts as a UINavigationController. PickerView's nav bar works fine in that case. ViewOne should not have a navigation bar. Any ideas?

    Read the article

  • Cannot run code on device

    - by lostInTransit
    Hi I have some source code which I had developed and later gave to another team. They signed it with their certificate and provisioning profile. Now I have the code back and have set the appropriate values in the project properties for code signing identity (with my cert and profile). But when I run the application on a device, I get an error showing the other team's certificate and prompting that the provisioning profile does not exist. I don't know where it is being referenced. Can someone please help. Thanks.

    Read the article

  • 'NSInvalidArgumentException' UIButton IBAction Error

    - by Graeme
    Hi, I have a button in a view which refuses to work. I've got in working in a blank, default view application from X-Code, but in none of my applications will it work, instead it gives me the following error. Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '* -[UIViewController showVicInfo:]: unrecognized selector sent to instance 0x3c084f0' The debugger isn't any help either. I've made sure that I hook up the button to the file's owner (not the other way around) as well. Below is the code for the action. And I know it's not the alert view, because the breakpoint doesn't even reach there. about.h @interface about : UIViewController { } -(IBAction)showInfo:(id)sender; about.m -(IBAction)showVicInfo:(id)sender { UIAlertView *myAlert = [[UIAlertView alloc] initWithTitle:@"No Internet Connection" message:@"You require an internet connection via WiFi or cellular network for iFirelert to work." delegate:self cancelButtonTitle:@"OK, thanks" otherButtonTitles:nil]; [myAlert show]; [myAlert release]; }

    Read the article

  • iPad app store visibility

    - by Jameson
    So I created my iPad app and submitted it to the store, the app is called photogoo. I now have the iPad and I am finding that it is not possible to browse to the app in any way, confirmed by the zero downloads from yesterday. It is only possible to find by searching.. I also noticed that the apps in entertainment were being listed alphabetically and stopped at "F" Am I really being excluded because my app starts with the letter "P" or is it possible there is some reason that I am not being listed under "all apps"?

    Read the article

  • Get Name by Cellphone number

    - by ganti
    Hy everyone I'm using a TextField where the user is typing in a phonenumber. When the TextField has changed it should check if this number is allready in the phonebook and display the name. So far, my only way is to parse all names and number in a Dict and read it from there. Is there a simpler more efficient and sophisticated way to do that. cheers simon

    Read the article

  • Replacing a calloutaccessoryview in mkannotationview

    - by Mugunth Kumar
    In my viewForAnnotation delegate, I create a MKAnnotationView with leftCalloutaccessory as a info button. When the info button is tapped, I want to replace it with a UIActivityIndicator. So in the calloutAccessoryTapped delegate, I wrote view.leftCalloutaccessoryView = [UIActivityIndicator indicatorWithStyle:UIActivityIndicatorWhite]; The callout accessory seems to change, but it seems like the view doesn't get updated immediately. That's when the callout accessory gets hidden (by tapping another pin) and is re-opened, I see a spinner. But otherwise, I don't. I tried calling [view setNeedsdisplay] and [view setNeedsLayout] and [view layoutsubviews] as well but in vain. Any suggestions/pointers?

    Read the article

  • Create a screen like the iPhone home screen with Scrollview and Buttons

    - by Anthony Chan
    Hi, I'm working on a project and need to create a screen similar to the iPhone home screen: A scrollview with multiple pages A bunch of icons When not in edit mode, swipe through different pages (even I started the touch on an icon) When not in edit mode, tap an icon to do something When in edit mode, drag the icon to swap places, and even swap to different pages When in edit mode, tap an icon to remove it Previously I read from several forums that I have to subclass UIScrollview in order to have touch input for the UIViews on top of it. So I subclassed it overriding the methods to handle touches: - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { //If not dragging, send event to next responder if (!self.dragging) [self.nextResponder touchesBegan:touches withEvent:event]; else [super touchesBegan:touches withEvent:event]; } In general I've override the touchesBegan:, touchesMoved: and touchesEnded: methods similarly. Then in the view controller, I added to following code: - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { UITouch *touch = [touches anyObject]; UIView *hitView = (UIView *)touch.view; if ([hitView isKindOfClass:[UIView class]]) { [hitView doSomething]; NSLog(@"touchesBegan"); } } - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { // Some codes to move the icons NSLog(@"touchesMoved"); } - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { NSLog(@"touchesEnded"); } When I run the app, I have the touchesBegan method detected correctly. However, when I tried to drag the icon, the icon just moved a tiny bit and then the page started to scroll. In console, it logged with 2 or 3 "touchesMoved" message only. However, I learned from another project that it should logged tonnes of "touchesMoved" message as long as I'm still dragging on the screen. (I'm suspecting I have the delaysContentTouches set to YES, so it delays a little bit when I tried to drag the icons. After that minor delay, it sends to signal back to the scrollview to scroll through the page. Please correct me if I'm wrong.) So if any help on the code to perform the above tasks would be greatly appreciated. I've stuck in this place for nearly a week with no hope. Thanks a lot.

    Read the article

  • App store name and info.plist

    - by user346194
    Hi guys, I've just completed my first app and having tested I'm ready for submission. However, despite numerous web searches and reading, I'm struggling to finalise the method required to enable me to have a different name on the app store to the name that appears under the app on the device home screen. In the plist.info file there is reference to bundle display name, executable name, bundle name, bundle identifier, product name etc. So, for example, say I would like the app store name to display as: HELLO WORLD and I would like the name below the icon on the device home screen to display as: HELLO How should I enter the data in the plist.info file to achieve the above? Many thanks in advance for your help. Gav.

    Read the article

  • Date Picker Blue

    - by Matt Winters
    I'm successfully setting a date-picker with an initial date from a plist, but I see some unwanted blue values in the month, day, and year components, presumably corresponding to current date. So if today is April 18, 2010 and initial date being set is March 19, 2008, it looks like this (bold represents the blue): January 17 2006 February 18 2007 ------------------------------ March 19 2008 ------------------------------ April 20 2009 May 21 2010 First question is: How do I get rid of the blue? And second question: Ideally, how do I get it to look like this? January 17 2006 February 18 2007 ------------------------------ March 19 2008 ------------------------------ April 20 2009 May 21 2010 Third question, totally unrelated and not as important: How could I have gotten the above to show in blue rather than bold? I see blue in code snippets all the time. Matt

    Read the article

  • iPhone UIImage upload to web service

    - by user347635
    Hi all, I worked on this for several hours today and I'm pretty close to a solution but clearly need some help from someone who's pulled this off. I'm trying to post an image to a web service from the iPhone. I'll post the code first then explain everything I've tried: NSData *imageData = UIImageJPEGRepresentation(barCodePic, .9); NSString *soapMsg = [NSString stringWithFormat: @"<?xml version=\"1.0\" encoding=\"utf-8\"?><soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\"><soap:Body><WriteImage xmlns=\"http://myserver/imagewebservice/\"><ImgIn>%@</ImgIn></WriteImage></soap:Body></soap:Envelope>", [NSData dataWithData:imageData] ]; NSURL *url = [NSURL URLWithString:@"http://myserver/imagewebservice/service1.asmx"]; NSMutableURLRequest *req = [NSMutableURLRequest requestWithURL:url]; NSString *msgLength = [NSString stringWithFormat:@"%d", [soapMsg length]]; [req addValue:@"text/xml; charset=utf-8" forHTTPHeaderField:@"Content-Type"]; [req addValue:@"http://myserver/imagewebservice/WriteImage" forHTTPHeaderField:@"SOAPAction"]; [req addValue:msgLength forHTTPHeaderField:@"Content-Length"]; [req setHTTPMethod:@"POST"]; [req setHTTPBody: [soapMsg dataUsingEncoding:NSUTF8StringEncoding]]; conn = [[NSURLConnection alloc] initWithRequest:req delegate:self]; if (conn) { webData = [[NSMutableData data] retain]; } First thing, this code works fine for anything but an image. The web service is running on my local network and I can change the source code at will and if I change the "ImgIn" parameter to a string and pass a string in, everything works fine, I get a return value no problem. So there are no connectivity issues at all, I'm able to call and get data from this web service on this server no problems. But I need to upload an image to this web service via the ImgIn parameter, so the above code is my best shot so far. I also have didReceiveResponse, didReceiveData, didFailWithError, etc all being handled. The above code fires off didRecieveResponse every time. However didReceiveData is never fired and it's like the web service itself never even runs. When I debug the web service itself, it runs and debugs fine when I use a string parameter, but with the image parameter, it never even debugs when I call it. It's almost like the ImgIn parameter is too long (it's huge when I output it to the screen) and the web service just chokes on it. I've read about having to encode to Base64 when using this method, but I can't find any good links on how that's done. If that's what I'm doing wrong, can you PLEASE provide code as to how to do this, not just "you need to use Base64", I'd really appreciate it as I can find almost nothing on how to implement this with an example. Other than that, I'm kind of lost, it seems like I'm doing everything else right. Please help! Thanks

    Read the article

< Previous Page | 154 155 156 157 158 159 160 161 162 163 164 165  | Next Page >