Search Results

Search found 585 results on 24 pages for 'autorelease'.

Page 9/24 | < Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >

  • setSearchDisplayController considered private-API?

    - by Adun
    Hi, I recently submitted an app for app review but I got rejected because of the use of a private API. I'm still a bit new to iPhone developing so I was wondering if someone could help me understand how this part was rejected: UISearchBar *searchBar = [[[UISearchBar alloc] initWithFrame:CGRectMake(0, 0, self.tableView.frame.size.width, 0)] autorelease]; searchBar.showsCancelButton = NO; searchBar.placeholder = @"Search Exhibitors"; [searchBar sizeToFit]; [self.tableView setTableHeaderView:searchBar]; UISearchDisplayController *searchDisplayController = [[UISearchDisplayController alloc] initWithSearchBar:searchBar contentsController:self]; [self performSelector:@selector(setSearchDisplayController:) withObject:searchDisplayController]; [searchDisplayController setDelegate:self]; [searchDisplayController setSearchResultsDataSource:self]; [searchDisplayController setSearchResultsDelegate:self]; [searchDisplayController release]; The part that they mentioned was the "setSearchDisplayController". I based the searching of a UITableView on the example given here. So can anyone explain why this is considered a private API?

    Read the article

  • Return Selected Phone Address from iPhone Address Book

    - by Ali
    Hey, I found a tutorial online that extends that Apple QuickStart Application which is the basic Address Book Application and another that returns the first phone number regardless of what phone number was clicked. I want to display only the selected phone number in the label. The label is called phoneNumber: - (BOOL)peoplePickerNavigationController: (ABPeoplePickerNavigationController *)peoplePicker shouldContinueAfterSelectingPerson:(ABRecordRef)person property:(ABPropertyID)property identifier:(ABMultiValueIdentifier)identifier{ ABMutableMultiValueRef phoneMulti = ABRecordCopyValue(person, kABPersonPhoneProperty); NSMutableArray *phones = [[NSMutableArray alloc] init]; int i; for (i = 0; i < ABMultiValueGetCount(phoneMulti); i++) { NSString *aPhone = [(NSString*)ABMultiValueCopyValueAtIndex(phoneMulti, i)autorelease]; [phones addObject:aPhone]; } NSString *mobileNo = [phones objectAtIndex:0]; self.phoneNumber.text = phones; [self dismissModalViewControllerAnimated:YES]; return NO; } How do I ensure that the label is the one selected by the user and not just the first array entry(or any other array entry i code in) Thanks

    Read the article

  • How do I properly add the Kal framework to my iPhone project?

    - by BeachRunnerJoe
    I'm new to iPhone development and I'm having trouble using the 3rd part Kal framework in my project. I can't find any documentation on how to add the Kal framework to my code, so I assumed it was just a matter of adding the source files to my project's "Groups and Files" and set the Header file search path to include the new code. Is that all I need to do to properly add the Kal framework to my iPhone project? I'm getting this error (shown below), what is it indicating? Undefined symbols: ".objc_class_name_KalViewController", referenced from: literal-pointer@__OBJC@__cls_refs@KalViewController in RootViewController.o ld: symbol(s) not found I get this error when I add the statement... kalViewController = [[[KalViewController alloc] init] autorelease]; to my RootViewController.m viewDidLoad method and #import "Kal.h" Thanks so much for your help!

    Read the article

  • How to set the title as left alignment in the UIButton.

    - by Madan Mohan
    Hi Guys, I need to dispaly the email address from left side of a UIButton, But it is getting in the center. Is there any way to set the alignment to the left side of a UIButton. UIButton* emailBtn = [[UIButton alloc] initWithFrame:CGRectMake(5,30,250,height+15)]; emailBtn.backgroundColor=[UIColor clearColor]; [emailBtn setTitle:obj2.customerEmail forState:UIControlStateNormal]; emailBtn.titleLabel.font = [UIFont systemFontOfSize:12.5]; [emailBtn setTitleColor:[[[UIColor alloc]initWithRed:0.121 green:0.472 blue:0.823 alpha:1]autorelease] forState:UIControlStateNormal]; [emailBtn addTarget:self action:@selector(emailAction:) forControlEvents:UIControlEventTouchUpInside]; [elementView addSubview:emailBtn]; [emailBtn release]; Please help me. Thank You, Madan Mohan.

    Read the article

  • Why Does the iPad Toolbar Refuse to Reappear When Orientation Changes?

    - by dugla
    I have a fullscreen OpenGL iPad app that behaves correctly for all orientation changes. I now want to add a UIToolbar programmatically and while it appears correctly in launch orientation - portrait in the Xcode simulator - it dissapears when the orientation changes to landscape. Change the orientation back to portrait and the Toolbar reapppears. Huh? - (void)loadView { NSLog(@"EAGL ViewController - load View"); CGRect frame = [[UIScreen mainScreen] applicationFrame]; EAGLView *eaglView = [[[EAGLView alloc] initWithFrame:frame] autorelease]; self.view = eaglView; [[NSBundle mainBundle] loadNibNamed:@"Toolbar" owner:self options:nil]; NSLog(@"%@", [[self.toolbar class] description]); [self.view addSubview:self.toolbar]; [self.view bringSubviewToFront:self.toolbar]; } What have I failed to do here? Thanks, Doug

    Read the article

  • Can NSDictionary be used with TableView on iPhone?

    - by bobo
    In a UITableViewController subclass, there are some methods that need to be implemented in order to load the data and handle the row selection event: - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return 1; //there is only one section needed for my table view } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return [myList count]; //myList is a NSDictionary already populated in viewDidLoad method } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease ]; } // indexPath.row returns an integer index, // but myList uses keys that are not integer, // I don't know how I can retrieve the value and assign it to the cell.textLabel.text return cell; } - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { // Handle row on select event, // but indexPath.row only returns the index, // not a key of the myList NSDictionary, // this prevents me from knowing which row is selected } How is NSDictionary supposed to work with TableView? What is the simplest way to get this done?

    Read the article

  • How to overlay view over navigation controller bar?

    - by 0SX
    I've sorta got a little problem. I'm trying to add a popoverview to my app but part of the popoverview get's hidden by my navigation controller bar. How can I make my popoverview overlay over top of the navcontrollerbar? Here's an image of the problem: http://img593.imageshack.us/img593/4056/viewn.jpg Here's my code I'm working with: - (IBAction)onButtonClick:(UIButton *)button { if (self.popoverController) { [self.popoverController dismissPopoverAnimated:YES]; self.popoverController = nil; [button setTitle:@"Show Popover" forState:UIControlStateNormal]; } else { UIViewController *contentViewController = [[WEPopoverContentViewController alloc] initWithStyle:UITableViewStylePlain]; self.popoverController = [[[WEPopoverController alloc] initWithContentViewController:contentViewController] autorelease]; [self.popoverController presentPopoverFromRect:button.frame inView:self.view permittedArrowDirections:UIPopoverArrowDirectionDown animated:YES]; [contentViewController release]; [button setTitle:@"Hide Popover" forState:UIControlStateNormal]; } } Is there anyway to make this popover above the navigation controller bar? Here is the full source code what I'm working with https://github.com/werner77/WEPopover Hopefully someone knows how to fix this problem, Thanks in advance.

    Read the article

  • UITableViewCellStyleDefault image size

    - by Rob Bonner
    Hello all, I am getting some odd behavior from stock table cells, or maybe not odd, maybe I am making some assumptions. I create the cells as follows: cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; Then I assign an image to the default imageView property. My image usually comes in from a user, so it might be larger than the default size. To take care of this I: [cell.imageView setContentMode:UIViewContentModeScaleAspectFit]; which I expected to scale the image for me within the control, but in reality, the images are all over the map. So, is there a proper way to constrain the image in stock cell types? Thanks in advance!

    Read the article

  • Avoiding EXC_BAD_ACCESS when using the delegate pattern

    - by Kenny Winker
    A have a view controller, and it creates a "downloader" object, which has a reference to the view controller (as a delegate). The downloader calls back the view controller if it successfully downloads the item. This works fine as long as you stay on the view, but if you navigate away before the download is complete I get EXC_BAD_ACCESS. I understand why this is happening, but is there any way to check if an object is still allocated? I tried to test using delegate != nil, and [delegate respondsToSelector:], but it chokes. if (!self.delegate || ![self.delegate respondsToSelector:@selector(downloadComplete:)]) { // delegate is gone, go away quietly [self autorelease]; return; } else { // delegate is still around [self.delegate downloadComplete:result]; } I know I could, a) have the downloader objects retain the view controller b) keep an array of downloaders in the view controller, and set their delegate values to nil when I deallocate the view controller. But I wonder if there is an easier way, where I just test if the delegate address contains a valid object?

    Read the article

  • CoreData many-to-many relationship NSPredicate Exceptions

    - by user307550
    I'm trying to model a Person/Team relationship. It's a many to many relationship since a person can belong to multiple teams and a team can have multiple people. As suggested by the doc I created an intermediate entity called TeamMember. I am now trying to run a query to see if I have a list of people, whether a pre-existing Team already exists for them so I'm not storing duplicate Teams in the database NSFetchRequest *request = [[[NSFetchRequest alloc] init] autorelease]; NSEntityDescription *entity = [NSEntityDescription entityForName:@"Team" inManagedObjectContext:[pm managedObjectContext]]; [request setEntity:entity]; NSPredicate *predicate = nil; predicate = [NSPredicate predicateWithFormat:@"ALL %K IN %@", @"teamMembers.person", players]; players is an NSSet of people that I'm trying to search I'm getting the following exception: Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Unsupported predicate ALL teamMembers.person IN { (entity: Person; id: 0x1334470 ; data: { Ideally I would like them to match exactly and not just do an IN as well. Any help would be greatly appreciated

    Read the article

  • iPhone: UITextField inside TableView cell?

    - by Nic Hubbard
    I am trying to programatically add a UITextFiled inside one of my tableview cells. How would I do this? Assuming it is in the following method, what code would I use? - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue2 reuseIdentifier:CellIdentifier] autorelease]; cell.editingAccessoryType = UITableViewCellAccessoryDisclosureIndicator; // Don't let the user click when not in editing mode cell.selectionStyle = UITableViewCellSelectionStyleNone; } switch (indexPath.row) { case 0: cell.textLabel.text = @"Title"; // This is where I want to add a text field cell.detailTextLabel.text = @"test"; cell.editing = YES; break; } return cell; }

    Read the article

  • EXEC_BAD_ACCESS in UITableView cellForRowAtIndexPath

    - by David van Dugteren
    My UITable is returning EXEC_BAD_ACCESS, but why! See this code snippet! Loading the UITableView works fine, so allXYZArray != nil and is populated! Then scrolling the tableview to the bottom and back up causes it to crash, as it goes to reload the method cellForRowAtIndexPath It fails on line: "NSLog(@"allXYZArray::count: %i", [allXYZArray count]);" - (UITableViewCell *)tableView:(UITableView *)theTableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"CellIdentifier"; UITableViewCell *cell = [theTableView dequeueReusableCellWithIdentifier:CellIdentifier]; cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; @try { if (allAdviceArray == nil) { NSLog(@"nil"); allXYZArray = [ToolBox getMergedSortedDictionaries:allXYZGiven SecondDictionary:allXYZSought]; } NSLog(@"%i", [indexPath row]); NSLog(@"allXYZArray::count: %i", [allXYZArray count]);

    Read the article

  • UIPickerView Custom Font

    - by Lee Armstrong
    I have the following code that I have found and tried to implement. I want to set the UIPickerView to have labels that I can customize the text in... When loading this it is just blank at the moment! - (UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view { UILabel *pickerLabel = (UILabel *)view; NSString *text = @"TTT"; // Reuse the label if possible, otherwise create and configure a new one if ((pickerLabel == nil) || ([pickerLabel class] != [UILabel class])) { //newlabel CGRect frame = CGRectMake(0.0, 0.0, 270, 32.0); pickerLabel = [[[UILabel alloc] initWithFrame:frame] autorelease]; pickerLabel.textAlignment = UITextAlignmentLeft; pickerLabel.backgroundColor = [UIColor clearColor]; pickerLabel.font = [UIFont fontWithName:@"AmericanTypewriter" size:28]; } pickerLabel.textColor = [UIColor brownColor]; return pickerLabel; }

    Read the article

  • Problem with migrating from Texture2D to CCTexture2D (Setting CCSprite texture)

    - by marie
    My problem is that whenever I change the texture of a sprite, the new texture will retain the size of the original sprite's texture. I have this code: mySprite = [CCSprite spriteWithFile:@"mySprite.png"]]; ... // change current stage here CCTexture2D *newTexture=[[[CCTexture2D alloc]initWithImage:[UIImage imageNamed:[NSString stringWithFormat:@"stage number %d.png",currentStageNumber]]]autorelease]; [mySprite setTexture:newTexture]; The new sprite is stretched or compressed depending on the size of the original sprite. If the original sprite is larger, the new texture is stretched. I didn't have this problem when I was using cocos2d v0.8 What am I doing wrong?

    Read the article

  • NSNumberFormatter weirdness with NSNumberFormatterPercentStyle

    - by rein
    Hi, I need to parse some text in a UITextField and turn it into a percentage. Ideally, I'd like the user to either type something like 12 or 12% into the text field and have that be parsed into a number as a percentage. Here's what's weird. The number formatter seems to not like 12 and seems to divide 12% by 10000 instead of 100: NSNumberFormatter *formatter = [[[NSNumberFormatter alloc] init] autorelease]; [formatter setNumberStyle:NSNumberFormatterPercentStyle]; NSNumber *n1 = [formatter numberFromString:@"12"]; NSNumber *n2 = [formatter numberFromString:@"12%"]; NSLog(@"n1 = %@", n1); // n1 = (null) NSLog(@"n2 = %@", n2); // n2 = 0.0012 How do I get the formatter to return 0.12 as expected? EDIT: it seems to only happen if the formatter fails first. If the formatter does not fail it returns 0.12 as expected. Strange.

    Read the article

  • Error: CLLocationManager headingAvailable

    - by Bubu4711
    I have the following code: In my .h-Header-File: #import <UIKit/UIKit.h> #import <CoreLocation/CoreLocation.h> @interface Compass : UIViewController <CLLocationManagerDelegate> { [...] CLLocationManager *locationManager; } [...] @property(nonatomic, retain) CLLocationManager *locationManager; @end And my .m-File: #import "[FILENAME].h" [...] @synthesize locationManager; - (void)viewDidLoad { [super viewDidLoad]; self.locationManager = [[[CLLocationManager alloc] init] autorelease]; if(locationManager.headingAvailable == NO) { [...] } [...] } And I get the following error Message for "locationManager.headingAvailable": error:request for member 'headingAvailable' in something not a structure or union I've added the CoreLocation framework to my app... Who can help me?

    Read the article

  • Is is possible to derive currency symbol from currency code?

    - by Dave Hunt
    My iPhone app formats an NSDecimalNumber as a currency using setCurrencyCode, however another screen displays just the currency symbol. Rather than storing both the currency code and symbol, is it possible to derive the symbol from the code? I thought the following might work, but it just returns the symbol as $: currencyCode = [dictPrices valueForKey:@"currencyCode"]; NSNumberFormatter *numberFormatter = [[[NSNumberFormatter alloc] init] autorelease]; [numberFormatter setFormatterBehavior:NSNumberFormatterBehavior10_4]; [numberFormatter setCurrencyCode:currencyCode]; [numberFormatter setNumberStyle:NSNumberFormatterCurrencyStyle]; NSString *currencySymbol = [numberFormatter currencySymbol];

    Read the article

  • objective-c Derived class may not respond to base class method

    - by zadam
    Hi, I have derived from a 3rd party class, and when I attempt to call a method in the base class, I get the x may not respond to y compiler warning. How can I remove the warning? Repro: @interface ThirdPartyBaseClass : NSObject {} +(id)build; -(void)doStuff; @end @implementation ThirdPartyBaseClass +(id) build{ return [[[self alloc] init] autorelease]; } -(void)doStuff{ } @end @interface MyDerivedClass : ThirdPartyBaseClass {} +(id)buildMySelf; @end @implementation MyDerivedClass +(id)buildMySelf{ self = [ThirdPartyBaseClass build]; [self doStuff]; // compiler warning here - 'MyDerivedClass' may not respond to '+doStuff' return self; } @end Thanks!

    Read the article

  • Core Location question....

    - by Moshe
    This tutorial on mobileorchard.com uses 2 classes (or 2 sets of .h and .m) to implement core location. Can I just use everything there in my existing class? How would I do that? Also, is the - (id) init { self = [super init]; if (self != nil) { self.locationManager = [[[CLLocationManager alloc] init] autorelease]; self.locationManager.delegate = self; // send loc updates to myself } return self; } method the same as the usual initWithNib? I;m trying to quickly implement something based on location information. As much help describing the above linked tutorial would be helpful. Thanks. No - really, Thank You.

    Read the article

  • Get CoreLocation Update before TableView population?

    - by Clemens
    hi, i have the corelocation stuff in an uitableview controller. i actually want to get a distance from two locations and print that distance in a tableview cell. the problem is, that the tableview is filled before all the corelocation stuff happens. how can i make corelocation makes all updates before the table is filled? heres my class: // // EntriesListViewController.m // OEAW_App // // Created by Clemens on 6/6/10. // Copyright 2010 MyCompanyName. All rights reserved. // import "EntriesListViewController.h" import "EntryDetailController.h" @implementation EntriesListViewController @synthesize locationManager; @synthesize delegate; NSMutableDictionary *entries; NSMutableDictionary *dictionary; CLLocation *coords; /- (id) init { self = [super init]; if (self != nil) { self.locationManager = [[[CLLocationManager alloc] init] autorelease]; self.locationManager.delegate = self; } return self; }/ (CLLocationManager *)locationManager { if (locationManager != nil) { return locationManager; } locationManager = [[CLLocationManager alloc] init]; locationManager.desiredAccuracy = kCLLocationAccuracyNearestTenMeters; locationManager.delegate = self; return locationManager; } (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation { //coords.longitude = newLocation.coordinate.longitude; //coords.latitude = newLocation.coordinate.latitude; coords = newLocation; NSLog(@"Location: %@", [newLocation description]); } (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error { NSLog(@"Error: %@", [error description]); } (void)viewDidLoad { //[[MyCLController alloc] init]; //[locationManager startUpdatingLocation]; [[self locationManager] startUpdatingLocation]; //---initialize the array--- //entries = [[NSMutableArray alloc] init]; //---add items--- //NSString *Path = [[NSBundle mainBundle] bundlePath]; //NSString *DataPath = [Path stringByAppendingPathComponent:@"Memorials.plist"]; dictionary = [[NSDictionary alloc] initWithContentsOfURL:[NSURL URLWithString: @"http://akm.madison.at/memorials.xml"]]; /*NSDictionary *dssItem = [dictionary objectForKey:@"1"]; NSString *text = [dssItem objectForKey:@"text"]; */ //entries = [[NSMutableDictionary alloc] init]; NSLog(@"%@", dictionary); //Path get the path to MyTestList.plist NSString *path=[[NSBundle mainBundle] pathForResource:@"Memorials" ofType:@"plist"]; //Next create the dictionary from the contents of the file. NSDictionary *dict=[NSDictionary dictionaryWithContentsOfFile:path]; //now we can use the items in the file. // self.name.text = [dict valueForKey:@"Name"] ; NSLog(@"%@",[dict valueForKey:@"Name"]); //---set the title--- self.navigationItem.title = @"Türkendenkmäler"; [super viewDidLoad]; } (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { // Return the number of sections. return 1; } (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { // Return the number of rows in the section. return [dictionary count]; } // Customize the appearance of table view cells. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:CellIdentifier] autorelease]; } // Configure the cell... NSArray *keys = [dictionary allKeys]; id key = [keys objectAtIndex:indexPath.row]; NSDictionary *tmp = [dictionary objectForKey:key]; NSString *name = [tmp objectForKey:@"name"]; cell.textLabel.text = name; cell.font = [UIFont fontWithName:@"Helvetica" size:12.0]; CLLocation *location = [[CLLocation alloc] initWithLatitude:[[tmp valueForKey:@"coords_x"] floatValue] longitude:[[tmp valueForKey:@"coords_y"] floatValue]]; /*CLLocation *newLoc = [[CLLocation alloc] initWithLatitude:coords.latitude longitude:coords.longitude];*/ //locationController = [[MyCLController alloc] init]; int distance = [coords distanceFromLocation:location]; NSLog(@"%@",distance); cell.detailTextLabel.text = [NSString stringWithFormat:@"%@m",distance]; //NSLog(@"%@", [getLocation newLoc]); return cell; } (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { EntryDetailController *detailViewController = [[EntryDetailController alloc] initWithNibName:@"EntryDetailController" bundle:nil]; //detailViewController.entrySelected = [dictionary objectAtIndex:indexPath.row]; NSArray *keys = [dictionary allKeys]; id key = [keys objectAtIndex:indexPath.row]; NSDictionary *tmp = [dictionary objectForKey:key]; NSString *name = [tmp objectForKey:@"name"]; detailViewController.entrySelected_name = name; NSString *location = [tmp objectForKey:@"location"]; detailViewController.entrySelected_location = location; NSString *type = [tmp objectForKey:@"type"]; detailViewController.entrySelected_type = type; NSString *slug = [tmp objectForKey:@"slug"]; detailViewController.entrySelected_slug = slug; [self.navigationController pushViewController:detailViewController animated:YES]; [detailViewController release]; } (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; } (void)dealloc { [entries release]; [super dealloc]; } @end

    Read the article

  • Memory cleanup on returned array from static method (objective-c)

    - by Michael Bordelon
    In objective-c, I have a utility class with a bunch of static methods that I call for various tasks. As an example, I have one method that returns an NSArray that I allocate in the static method. If I set the NSArray to autorelease, then some time later, the NSArray in my calling method (that is assigned to the returned pointer) losses it's reference because the original form the static method is cleaned up. I can't release the NSArray object in the static method because it needs to be around for the return and assignment. What is the right way to return an object (like the NSArray) from a static class, and have it hang around for the calling class, but then get cleaned up later when it is no longer needed? Do I have to create the object first in the caller and pass in a pointer to the object and then return that same object form the static method? I know this is a basic O-O problem, I just never had this issue in Java and I do not do much C/C++. Thanks for your help.

    Read the article

  • UINavigationController Right button

    I am unable to set any property of parentController (which is always a UINavigationController in my case) from child views. e.g. I want to add a button on the navigation bar using following code: UINavigationController* parentController = (UINavigationController)self.parentViewController; UIBarButtonItem *addButton = [[[UIBarButtonItem alloc] initWithTitle:@"Something" style:UIBarButtonItemStyleBordered target:self action:@selector(doSomething)] autorelease]; [_parentController.navigationItem setRightBarButtonItem:addButton animated:YES]; This code runs perfectly without errors but I can't see any button added to the navigation bar. Thanks in advance.

    Read the article

  • Items mixed up after scrolling in UITableView

    - by jean
    When I scroll in my UITableView, the cells become mixed up. What am I doing wrong? This is my method: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; } [cell insertSubview:[itemArray objectAtIndex:indexPath.row] atIndex:indexPath.row]; return cell; } Update It now works by using cell.contentView, but now when I select an item, the selected one is overlayed with the content of a different cell...

    Read the article

  • Iphone SDk inString Function

    - by Skeep
    Hi All, Im trying to write a method that will pull out the ID from a URI String. My code below seems inefficient, what would be a better way of finding the id string? NSString *aID = [[[NSString alloc] initWithString:@"http://www.example.com/id368907840?mt=8&uo=4"] autorelease]; NSArray *arrStr = [aID componentsSeparatedByString:@"/id"]; aID = [arrStr objectAtIndex:1]; arrStr = [aID componentsSeparatedByString:@"?mt="]; aID = [arrStr objectAtIndex:0]; The above leaves me with the NSString = 368907840

    Read the article

  • iPhone Google Maps KML Search

    - by satyam
    I'm using Google maps with KML Query. But my query string is "Japanese" string "??????" I'm using http://maps.google.co.jp. When requesting data, I'm getting "0" bytes. But the same query when I put in browser, its download a KML file. My code is as follows: query = [NSString stringWithFormat:@"http://maps.google.co.jp/maps?&near=%f,%f&q=??????&output=kml&num=%d", lat,lon, num]; NSURL* url = [NSURL URLWithString:query]; NSURLRequest* request = [NSURLRequest requestWithURL:url]; NSLog(@"Quering URL = %@", url); NSHTTPURLResponse *response = [[NSHTTPURLResponse alloc] autorelease]; NSData *myData = [NSURLConnection sendSynchronousRequest:request returningResponse: &response error: nil ]; NSInteger errorcode = [response statusCode]; I'm receiving "myData" with 0 bytes. why?

    Read the article

< Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >