Search Results

Search found 3 results on 1 pages for 'mshsayem'.

Page 1/1 | 1 

  • Few iPhone noob questions

    - by mshsayem
    Why should I declare local variables as 'static' inside a method? Like: static NSString *cellIdentifier = @"Cell"; Is it a performance advantage? (I know what 'static' does; in C context) What does this syntax mean?[someObj release], someObj = nil; Two statements? Why should I assign nil again? Is not 'release' enough? Should I do it for all objects I allocate/own? Or for just view objects? Why does everyone copy NSString, but retains other objects (in property declaration)? Yes, NSStrings can be changed, but other objects can be changed also, right? Then why 'copy' for just NSString, not for all? Is it just a defensive convention? Shouldn't I release constant NSString? Like here:NSString *CellIdentifier = @"Cell"; Why not? Does the compiler allocate/deallocate it for me? In some tutorial application I observed these (Built with IB): Properties(IBOutlet, with same ivar name): window, someLabel, someTextField, etc etc... In the dealloc method, although the window ivar was released, others were not. My question is: WHY? Shouldn't I release other ivars(labels, textField) as well? Why not? Say, I have 3 cascaded drop-down lists. I mean, based on what is selected on the first list, 2nd list is populated and based on what is selected on the second list, 3rd list is populated. What UI components can reflect this best? How is drop-down list presented in iPhone UI? Tableview with UIPicker? When should I update the 2nd, 3rd list? Or just three labels which have touch events? Can you give me some good example tutorials about Core-Data? (Not just simple data fetching and storing on 2/3 tables with 1/2 relationship) How can I know whether my app is leaking memory? Any tools?

    Read the article

  • How to view existing data in Core Data?

    - by mshsayem
    Well, may be this question is silly, but I couldn't find a way (except programmatically). I built a project (for iPhone OS 3.0) which uses Core Data. The xcdatamodel file shows the schema description, but I want to see the data in tabular form (like the management studio for mssql server or phpmyadmin for mysql). Is there any way (except coding)? What is that? Also, which file (in disk/device) those data are stored into? [ I built the tutorial (from apple) on Core Data, named Locations. They used this line somewhere in the code: NSURL *storeUrl = [NSURL fileURLWithPath: [[self applicationDocumentsDirectory] stringByAppendingPathComponent: @"Locations.sqlite"]]; But, I did not see any "xxxxx.sqlite" file in project location (nor in the disk).]

    Read the article

  • How to resize a UISwitch?

    - by mshsayem
    I have made a custom UISwitch (from this post). But the problem is, my custom texts are a bit long. Is there any way to resize the switch? [I tried setBounds, did not work] Edit: Here is the code I used: @interface CustomUISwitch : UISwitch - (void) setLeftLabelText: (NSString *) labelText; - (void) setRightLabelText: (NSString *) labelText; @end @implementation CustomUISwitch - (UIView *) slider { return [[self subviews] lastObject]; } - (UIView *) textHolder { return [[[self slider] subviews] objectAtIndex:2]; } - (UILabel *) leftLabel { return [[[self textHolder] subviews] objectAtIndex:0]; } - (UILabel *) rightLabel { return [[[self textHolder] subviews] objectAtIndex:1]; } - (void) setLeftLabelText: (NSString *) labelText { [[self leftLabel] setText:labelText]; } - (void) setRightLabelText: (NSString *) labelText { [[self rightLabel] setText:labelText]; } @end mySwitch = [[CustomUISwitch alloc] initWithFrame:CGRectZero]; //Tried these, but did not work //CGRect aFrame = mySwitch.frame; //aFrame.size.width = 200; //aFrame.size.height = 100; //mySwitch.frame = aFrame; [mySwitch setLeftLabelText: @"longValue1"]; [mySwitch setRightLabelText: @"longValue2"];

    Read the article

1