Search Results

Search found 4564 results on 183 pages for 'sencha touch 2'.

Page 37/183 | < Previous Page | 33 34 35 36 37 38 39 40 41 42 43 44  | Next Page >

  • View Controller's viewDidLoad method finishing before applicationDidFinishLaunching

    - by mwt
    I'm creating a fairly complex iPhone app using Core Data. Up until now, things have been working fine. As the app has been getting more complex, however, a new problem has come up: the first view controller is finishing its viewDidLoad method before the AppDelegate gets even halfway through its applicationDidFinishLaunching method. The view controller is not the root, which is a tab bar controller. The VC in question is the one for the default selected tab on the tab bar. It's getting instantiated by IB. Nothing like this has occurred before in my experience, and it's throwing off the important initialization I'm doing in the AppDelegate (getting objects from Core Data and preparing them for use) . Furthermore, it's intermittent -- sometimes the delegate does finish first. Has anyone else noticed a difficulty like this? Any sample code that deals with such an issue? I suppose that the answer is to make the VC load the data that the AppDelegate is getting ready only when the AppDelegate sends a message that it's ready. I'm a bit concerned that this is adding something that will just end up biting me in the butt later on.

    Read the article

  • What's the UITableView index magnifying glass character?

    - by David Grant
    In Apple's iPhone apps (like Contacts), they have a nice magnifying glass icon at the top of the table view index. Since the table view index API is character-based, I assume that this magnifying glass is a Unicode character. So far I've resorted to placing a question mark character there, but that looks lame. Can anyone tell me what character the magnifying glass is?

    Read the article

  • How to set up a user Quartz2D coordinate system with scaling that avoids fuzzy drawing?

    - by jdmuys
    This topic has been scratched once or twice, but I am still puzzled. And Google was not friendly either. Since Quartz allows for arbitrary coordinate systems using affine transform, I want to be able to draw things such as floorplans using real-life coordinate, e.g. feet. So basically, for the sake of an example, I want to scale the view so that when I draw a 10x10 rectangle (think a 1-inch box for example), I get a 60x60 pixels rectangle. It works, except the rectangle I get is quite fuzzy. Another question here got an answer that explains why. However, I'm not sure I understood that reason why, and moreover, I don't know how to fix it. Here is my code: I set my coordinate system in my awakeFromNib custom view method: - (void) awakeFromNib { CGAffineTransform scale = CGAffineTransformMakeScale(6.0, 6.0); self.transform = scale; } And here is my draw routine: - (void)drawRect:(CGRect)rect { CGContextRef context = UIGraphicsGetCurrentContext(); CGRect r = CGRectMake(10., 10., 11., 11.); CGFloat lineWidth = 1.0; CGContextStrokeRectWithWidth(context, r, lineWidth); } The square I get is scaled just fine, but totally fuzzy. Playing with lineWidth doesn't help: when lineWidth is set smaller, it gets lighter, but not crisper. So is there a way to set up a view to have a scaled coordinate system, so that I can use my domain coordinates? Or should I go back and implementing scaling in my drawing routines? Note that this issue doesn't occur for translation or rotation. Thanks

    Read the article

  • NSMutableDictionary, alloc, init and reiniting...

    - by Marcos Issler
    In the following code: //anArray is a Array of Dictionary with 5 objs. //here we init with the first NSMutableDictionary *anMutableDict = [[NSMutableDictionary alloc] initWithDictionary:[anArray objectAtIndex:0]]; ... use of anMutableDict ... //then want to clear the MutableDict and assign the other dicts that was in the array of dicts for (int i=1;i<5;i++) { [anMutableDict removeAllObjects]; [anMutableDict initWithDictionary:[anArray objectAtIndex:i]]; } Why this crash? How is the right way to clear an nsmutabledict and the assign a new dict? Thanks guy's. Marcos.

    Read the article

  • Extracting images from a PDF

    - by sagar
    My Query I want to extract only images from a PDF document, using Objective-C in an iPhone Application. My Efforts I have gone through the info on this link, which has details regarding different operators on PDF documents. I also studied this document from Apple about PDF parsing with Quartz. I also went through the entire PDF reference document from the Adobe site. According to that document, for each image there are the following operators: q Q BI EI I have created a table to get the image: myTable = CGPDFOperatorTableCreate(); CGPDFOperatorTableSetCallback(myTable, "q", arrayCallback2); CGPDFOperatorTableSetCallback(myTable, "TJ", arrayCallback); CGPDFOperatorTableSetCallback(myTable, "Tj", stringCallback); I use this method to get the image: void arrayCallback2(CGPDFScannerRef inScanner, void *userInfo) { // THIS DOESN'T WORK // CGPDFStreamRef stream; // represents a sequence of bytes // if (CGPDFDictionaryGetStream (d, "BI", &stream)){ // CGPDFDataFormat t=CGPDFDataFormatJPEG2000; // CFDataRef data = CGPDFStreamCopyData (stream, &t); // } } This method is called for the operator "q", but I don't know how to extract an image from it. What should be the solution for extracting the images from the PDF documents? Thanks in advance for your kind help.

    Read the article

  • Doesn't [UIWindow addSubView:] retain?

    - by Dan Ray
    Check it: NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; NSLog(@"Checking login--user value is %@", [defaults valueForKey:@"userID"]); if ([defaults valueForKey:@"userID"] == NULL){ LoginViewController *loginController = [[LoginViewController alloc] initWithNibName:@"LoginView" bundle:nil]; [window addSubview:loginController.view]; [loginController release]; } else { [window addSubview:[navigationController view]]; } Every other place when I put a subview into another view, I release that view after I've done that, because it's now owned by the view it's a subview of. HERE, though, when I do [loginController release], every IBAction on that loginController gets called against a deallocated instance. Commenting out that line makes everything work. I note the difference in approach between my loginController and the navigationController that came with the template; the navigationController is a synthesized property that gets released in -(void)dealloc{ }, so it's still around after being put into window.

    Read the article

  • Stop UITextView from jumping when programatically setting text

    - by Michael Waterfall
    Hi there, I have to update a small amount of text in a scrolling UITextView. I'll only be inserting a character where the cursor currently is, and I'll be doing this on a press of a button on my navigation bar. My problem is that whenever I call the setText method of the text view, it jumps to the bottom of the text. I've tried using contentOffset and resetting the selectedRange but it doesn't work! Here's my example: // Remember offset and selection CGPoint contentOffset = [entryTextView contentOffset]; NSRange selectedRange = [entryTextView selectedRange]; // Update text entryTextView.text = entryTextView.text; // Try and reset offset and selection [entryTextView setContentOffset:contentOffset animated:NO]; [entryTextView setSelectedRange: selectedRange]; Is there any way you can update the text without any scroll movement at all... as if they'd just typed something on the keyboard? Many thanks, Michael Edit: I've tried using the textViewDidChange: delegate method but it's still not scrolling up to the original location. - (void)textViewDidChange:(UITextView *)textView { if (self.programChanged) { [textView setSelectedRange:self.selectedRange]; [textView setContentOffset:self.contentOffset animated:NO]; self.programChanged = NO; } } - (void)changeButtonPressed:(id)sender { // Remember position self.programChanged = YES; self.contentOffset = [entryTextView contentOffset]; self.selectedRange = [entryTextView selectedRange]; // Update text entryTextView.text = entryTextView.text; }

    Read the article

  • UIScrollView only works if the child views aren't hit

    - by dny238
    I have a scroll view that doesn't scroll right, I've simplified the code for below. It draws the view and some horizontal buttons that i add more stuff to in the real code. If you drag the whitespace between the buttons the view scrolls. If you happen to put your finger on a button, it won't scroll. After a related suggestion, I tried to add the delaysContentTouches = YES line, but it doesn't seem to make a difference. http://stackoverflow.com/questions/650437/iphone-uiscrollview-with-uibuttons-how-to-recreate-springboard What am I doing wrong? TIA, Rob Updated the code - (void)viewDidLoad { l = [self landscapeView]; [self.view addSubview:l]; [l release]; } - (UIScrollView *) landscapeView { // LANDSCAPE VIEW UIScrollView *landscapeView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, 320, 325)]; landscapeView.backgroundColor = [UIColor whiteColor]; landscapeView.delaysContentTouches = YES; NSInteger iMargin, runningY, n; iMargin = 3; runningY = iMargin; for (n = 1; n <= 38; n++) { //add day labels UIButton *templabel = [[UIButton alloc] initWithFrame:CGRectMake(iMargin,runningY,320 - ( 2 * iMargin),20)]; templabel.backgroundColor = [UIColor grayColor]; [landscapeView addSubview:templabel]; [templabel release]; runningY = runningY + 30; } landscapeView.contentSize = CGSizeMake( 320, runningY); return landscapeView; }

    Read the article

  • Navigate to a SplitViewController

    - by Staros
    Hey all... I've been playing around with the iPad SDK looking for ways to improve my current iPhone app. I've got a couple place where I think the new "SplitView" would look pretty good. My question is if it's possible to navigate to a "SplitView" with my current navigation based application? Mainly I'm not sure how to push that SplitViewController onto my current stack of views. Any thoughts?

    Read the article

  • How to have two UIPickerViews together in one ViewController?

    - by 0SX
    I'm trying to put 2 UIPickerViews together in one ViewController. Each UIPickerView has different data arrays. I'm using interface builder to link the pickers up. I know I'll have to use separate delegates and dataSources but I can't seem to hook everything up with interface builder correctly. Here's all my code: pickerTesting.h #import <UIKit/UIKit.h> #import "picker2DataSource.h" @interface pickerTestingViewController : UIViewController <UIPickerViewDelegate, UIPickerViewDataSource>{ IBOutlet UIPickerView *picker; IBOutlet UIPickerView *picker2; NSMutableArray *pickerViewArray; } @property (nonatomic, retain) IBOutlet UIPickerView *picker; @property (nonatomic, retain) IBOutlet UIPickerView *picker2; @property (nonatomic, retain) NSMutableArray *pickerViewArray; @end pickerTesting.m #import "pickerTestingViewController.h" @implementation pickerTestingViewController @synthesize picker, picker2, pickerViewArray; - (void)viewDidLoad { [super viewDidLoad]; pickerViewArray = [[NSMutableArray alloc] init]; [pickerViewArray addObject:@" 100 "]; [pickerViewArray addObject:@" 200 "]; [pickerViewArray addObject:@" 400 "]; [pickerViewArray addObject:@" 600 "]; [pickerViewArray addObject:@" 1000 "]; [picker selectRow:1 inComponent:0 animated:NO]; picker2.delegate = self; picker2.dataSource = self; } - (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)picker; { return 1; } - (void)pickerView:(UIPickerView *)picker didSelectRow:(NSInteger)row inComponent:(NSInteger)component { } - (NSInteger)pickerView:(UIPickerView *)picker numberOfRowsInComponent:(NSInteger)component; { return [pickerViewArray count]; } - (NSString *)pickerView:(UIPickerView *)picker titleForRow:(NSInteger)row forComponent:(NSInteger)component; { return [pickerViewArray objectAtIndex:row]; } - (void)didReceiveMemoryWarning { // Releases the view if it doesn't have a superview. [super didReceiveMemoryWarning]; // Release any cached data, images, etc that aren't in use. } - (void)viewDidUnload { // Release any retained subviews of the main view. // e.g. self.myOutlet = nil; } - (void)dealloc { [super dealloc]; } @end And I have a separate class for the other datasource. picker2DataSource.h @interface picker2DataSource : NSObject <UIPickerViewDataSource, UIPickerViewDelegate> { NSMutableArray *customPickerArray; } @property (nonatomic, retain) NSMutableArray *customPickerArray; @end picker2DataSource.m #import "picker2DataSource.h" @implementation picker2DataSource @synthesize customPickerArray; - (id)init { // use predetermined frame size self = [super init]; if (self) { customPickerArray = [[NSMutableArray alloc] init]; [customPickerArray addObject:@" a "]; [customPickerArray addObject:@" b "]; [customPickerArray addObject:@" c "]; [customPickerArray addObject:@" d "]; [customPickerArray addObject:@" e "]; } return self; } - (void)dealloc { [customPickerArray release]; [super dealloc]; } - (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)picker2; { return 1; } - (void)pickerView:(UIPickerView *)picker2 didSelectRow:(NSInteger)row inComponent:(NSInteger)component { } - (NSInteger)pickerView:(UIPickerView *)picker2 numberOfRowsInComponent:(NSInteger)component; { return [customPickerArray count]; } - (NSString *)pickerView:(UIPickerView *)picker2 titleForRow:(NSInteger)row forComponent:(NSInteger)component; { return [customPickerArray objectAtIndex:row]; } @end Any help or code examples would be great. Thanks.

    Read the article

  • AVAudioPlayer only initializes with some files

    - by Brendan
    Hi everyone, I'm having trouble playing some files with AVAudioPlayer. When I try to play a certain m4a, it works fine. It also works with an mp3 that I try. However it fails on one particular mp3 every time (15 Step, by Radiohead), regardless of the order in which I try to play them. The audio just does not play, though the view loading and everything that happens concurrently happens correctly. The code is below. I get the "Player loaded." log output on the other two songs, but not on 15 Step. I know the file path is correct (I have it log outputted earlier in the app, and it is correct). Any ideas? NSData *musicData = [NSData dataWithContentsOfURL:[[NSURL alloc] initFileURLWithPath:[[NSBundle mainBundle] pathForResource:[song filename] ofType:nil]]]; NSLog([[NSBundle mainBundle] pathForResource:[song filename] ofType:nil]); if(musicData) { NSLog(@"File found."); } self.songView.player = [[AVAudioPlayer alloc] initWithData:musicData error:nil]; if(self.songView.player) { NSLog(@"Player loaded."); } [self.songView.player play]; NSLog(@"You should be hearing something now."); Thanks, Brendan

    Read the article

  • Core Data vs. SQLitePersistentObjects

    - by Macatomy
    I'm creating an iPhone app and I'm trying to choose between 2 solutions for a persistent store. Core Data, or SQLitePersistentObjects. Basically, all my app needs is a way to store an array of model objects and then load them again to display in a UITableView. Its nothing too complicated. Core Data seems to have a much higher learning curve than the simple to use SQLitePersistentObjects. Are there any obvious benefits of using Core Data over SQLitePersistentObjects in my case?

    Read the article

  • iPhone & iPad versions of same app?

    - by 4thSpace
    I have an iPhone app and would like to create iPad version of it. What is the best way to setup the project when you want an iPhone and iPad version of the app? I don't see that I'm able to use the same code base since the iPad version will have features in it that the iPhone version doesn't. It seems as though maintenance is going to go up with two similar code bases for the same app.

    Read the article

  • Adding Emboss to a UILabel in a navigationItem.titleView (as seen with navigationItem.title)

    - by Sahil
    I'm trying to mimic the default emboss that automatically gets applied to navigationItem.title, as well as many other UIKit controls. As seen in this screenshot's title ("Table Cells"): I'm essentially trying to add 2 UILabels to the navigationItem.titleView, however the UILabels just show up as flatly drawn and it really just doesn't feel/look right :P I've thought about playing with shadows, but that would only give the embossed look (if even that) on one side of the label. Any ideas would be great! Thanks

    Read the article

  • Why are my "tel:" links not working

    - by Griffo
    I have a tableView which has cells with phone numbers. The app is not dialing the numbers though. See the code below - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { if (indexPath.section == 2) { UITableViewCell *selectedCell = [tableView cellForRowAtIndexPath:indexPath]; NSString *numberToDial = [NSString stringWithFormat:@"tel:%@", selectedCell.detailTextLabel.text]; NSLog(@"%@",numberToDial); [[UIApplication sharedApplication] openURL:[NSURL URLWithString:numberToDial]]; } } Console ouput: 2010-03-08 01:32:30.830 AIB[1217:207] tel:01 8350098 As you can see, the number goes to the console, but doesn't get dialled. The weird thing is, if I change the last statement to this: [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel:171"]]; the phone dials the number 171 without any issue

    Read the article

  • Darkening a UIView

    - by igul222
    I'd like to "darken" a UIView by a certain amount. Right now, I'm doing the darkening like this: UIView *overlay = [[UIView alloc] initWithFrame:mainView.bounds]; overlay.backgroundColor = [UIColor blackColor]; overlay.alpha = 0.5f; [mainView addSubview:overlay]; Unfortunately, this also adds a semi-transparent black overlay to parts of mainView that are transparent. Is there any way to only darken the non-transparent sections?

    Read the article

  • How to use NSPredicate to catch child objects?

    - by Konstantin
    I'm new to core data and try to get all children objects of various types with one query. Say there's an "Animal" type as parent and "Cat", "Dog" and "Bird" as children. I'd like to get both cats and dogs, but not Birds in single query returned as Animal objects. Is it possible?

    Read the article

  • NSDateFormatter problem

    - by jeeva
    I am trying to get NSDate from string but its returning nil. I tried this: NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; [dateFormatter setDateFormat:@"yyyy-mm-dd'T'HH:mm:ss'Z'"]; NSDate *date = [dateFormatter dateFromString:@"2010-05-07T10:12:32UTC"]; NSLog(@"Success date=%@",[date description]); Thanks

    Read the article

  • UITableView programatically create delegate object?

    - by fuzzygoat
    I have a question regarding setting up a custom delegate class for use with UITableView. What I have done is as follows: Setup a new class (in sperate *.h and *.m files for the class) Conformed that new class to the <UITableViewDelegate, UITableViewDataSource> protocols Added the required methods. Created a pointer to the new object using @property and IBOutlet. In InterfaceBuilder created and assigned an object template to my new class Assigned the dataSource and delegate connections. This all works fine. My question is if I don't want to use interfaceBuilder to setup and instantiate my new delegate class directly in Xcode how do I go about doing that? More specifically how would I: Instantiate the delegate class, would that be created / owned by the controller? Set the dataSource and delegate connections? What is the best way of doing this? any help / information is much appreciated. Gary

    Read the article

  • Hiding a UINavigationController's UIToolbar during viewWillDisappear:

    - by Nathan de Vries
    I've got an iPhone application with a UITableView menu. When a row in the table is selected, the appropriate view controller is pushed onto the application's UINavigationController stack. My issue is that the MenuViewController does not need a toolbar, but the UIViewControllers which are pushed onto the stack do. Each UIViewController that gets pushed calls setToolbarHidden:animated: in viewDidAppear:. To hide the toolbar, I call setToolbarHidden:animated: in viewWillDisappear:. Showing the toolbar works, such that when the pushed view appears the toolbar slides up and the view resizes correctly. However, when the back button is pressed the toolbar slides down but the view does not resize. This means that there's a black strip along the bottom of the view as the other view transitions in. I've tried adding the toolbar's height to the height of the view prior to hiding the toolbar, but this causes the view to be animated during the transition so that there's still a black bar. I realise I can manage my own UIToolbar, but I'd like to use UINavigationControllers built in UIToolbar for convenience. This forum post mentions the same issue, but no workaround is mentioned.

    Read the article

  • Handling multiple UISwitch controls in a table view without using tag property

    - by Thaurin
    I have a table view controller with multiple UISwitch controls in them. I set the delegate to the table view controller with the same action for all switches. I need to be able to determine what switch was changed, so I create an array of strings that contains the name of each switch. The indexes in the array will be put in the tag property of each UISwitch. However, I'm ready using the tag property for something else, namely to find the right control in the cell in cellForRowAtIndexPath with viewWithTag! (There are several things I need to set within each cell.) So, am I thinking along the right lines here? I feel I'm rather limited in how I find out exactly which UISwitch changed its value, so I can do something useful with it.

    Read the article

  • How can I use this animation code?

    - by O.C.
    I'm a newbie and I need some help. I want to display a popup image over a given UIView, but I would like it to behave like the UIAlertView or like the Facebook Connect for iPhone modal popup window, in that it has a bouncy, rubbber-band-like animation to it. I found some code on the net from someone who was trying to do something similar. He/she put this together, but there was no demo or instructions. Being that I am so new, I don't have any idea as to how to incorporate this into my code. This is the routine where I need the bouncy image to appear: - (void) showProductDetail { . . . //////////////////////////////////////////////////////////////////////// // THIS IS A STRAIGHT SCALE ANIMATION RIGHT NOW. I WANT TO REPLACE THIS // WITH A BOUNCY RUBBER-BAND ANIMATION _productDetail.transform = CGAffineTransformMakeScale(0.1,0.1); [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDuration:0.5]; _productDetail.transform = CGAffineTransformMakeScale(1,1); [UIView commitAnimations]; } . . . } This is the code I found: float pulsesteps[3] = { 0.2, 1/15., 1/7.5 }; - (void) pulse { self.transform = CGAffineTransformMakeScale(0.6, 0.6); [UIView beginAnimations:nil context:nil]; [UIView setAnimationDuration:pulsesteps[0]]; [UIView setAnimationDelegate:self]; [UIView setAnimationDidStopSelector:@selector(pulseGrowAnimationDidStop:finished:context:)]; self.transform = CGAffineTransformMakeScale(1.1, 1.1); [UIView commitAnimations]; } - (void)pulseGrowAnimationDidStop:(NSString *)animationID finished:(NSNumber *)finished context:(void *)context { [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDuration:pulsesteps[1]]; [UIView setAnimationDelegate:self]; [UIView setAnimationDidStopSelector:@selector(pulseShrinkAnimationDidStop:finished:context:)]; self.transform = CGAffineTransformMakeScale(0.9, 0.9); [UIView commitAnimations]; } - (void)pulseShrinkAnimationDidStop:(NSString *)animationID finished:(NSNumber *)finished context:(void *)context { [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDuration:pulsesteps[2]]; self.transform = CGAffineTransformIdentity; [UIView commitAnimations]; } Thanks in advance for any help that you can give me.

    Read the article

< Previous Page | 33 34 35 36 37 38 39 40 41 42 43 44  | Next Page >