Search Results

Search found 2735 results on 110 pages for 'xcode'.

Page 19/110 | < Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >

  • My xcode mapview wont work when combined with webview

    - by user1715702
    I have a small problem with my mapview. When combining the mapview code with the code for webview, the app does not zoom in on my position correctly (just gives me a world overview where i´m supposed to be somewhere in California - wish I was). And it doesn´t show the pin that I have placed on a specific location. These things works perfectly fine, as long as the code does not contain anything concerning webview. Below you´ll find the code. If someone can help me to solve this, I would be som thankful! ViewController.h #import <UIKit/UIKit.h> #import <MapKit/MapKit.h> #define METERS_PER_MILE 1609.344 @interface ViewController : UIViewController <MKMapViewDelegate>{ BOOL _doneInitialZoom; IBOutlet UIWebView *webView; } @property (weak, nonatomic) IBOutlet MKMapView *_mapView; @property (nonatomic, retain) UIWebView *webView; @end ViewController.m #import "ViewController.h" #import "NewClass.h" @interface ViewController () @end @implementation ViewController @synthesize _mapView; @synthesize webView; - (void)viewDidLoad { [super viewDidLoad]; [_mapView setMapType:MKMapTypeStandard]; [_mapView setZoomEnabled:YES]; [_mapView setScrollEnabled:YES]; MKCoordinateRegion region = { {0.0,0.0} , {0.0,0.0} }; region.center.latitude = 61.097557; region.center.longitude = 12.126545; region.span.latitudeDelta = 0.01f; region.span.longitudeDelta = 0.01f; [_mapView setRegion:region animated:YES]; newClass *ann = [[newClass alloc] init]; ann.title = @"Hjem"; ann.subtitle = @"Her bor jeg"; ann.coordinate = region.center; [_mapView addAnnotation:ann]; NSString *urlAddress = @"http://google.no"; //Create a URL object. NSURL *url = [NSURL URLWithString:urlAddress]; //URL Requst Object NSURLRequest *requestObj = [NSURLRequest requestWithURL:url]; //Load the request in the UIWebView. [webView loadRequest:requestObj]; } - (void)viewDidUnload { [self setWebView:nil]; [self set_mapView:nil]; [super viewDidUnload]; // Release any retained subviews of the main view. } - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown); } - (void)viewWillAppear:(BOOL)animated { // 1 CLLocationCoordinate2D zoomLocation; zoomLocation.latitude = 61.097557; zoomLocation.longitude = 12.126545; // 2 MKCoordinateRegion viewRegion = MKCoordinateRegionMakeWithDistance(zoomLocation, 0.5*METERS_PER_MILE, 0.5*METERS_PER_MILE); // 3 MKCoordinateRegion adjustedRegion = [_mapView regionThatFits:viewRegion]; // 4 [_mapView setRegion:adjustedRegion animated:YES]; } @end NewClass.h #import <UIKit/UIKit.h> #import <MapKit/MKAnnotation.h> @interface newClass : NSObject{ CLLocationCoordinate2D coordinate; NSString *title; NSString *subtitle; } @property (nonatomic, assign) CLLocationCoordinate2D coordinate; @property (nonatomic, copy) NSString *title; @property (nonatomic, copy) NSString *subtitle; @end NewClass.m #import "NewClass.h" @implementation newClass @synthesize coordinate, title, subtitle; @end

    Read the article

  • localize many images in Xcode at once?

    - by Sebastian
    I have this project that i need to add a translation to. I already know how to add localisation to single image files, but there are 200+ images with text on it in that project. Do i really have to click one file at a time, "get info", click "add localisation" enter the Language and click OK for every file? When i select multiple images the languages and do those steps the new language is not added :-/ Please someone have a way to save me from insanity ;-) Thanks! S

    Read the article

  • XCode - Multiple targets, Multiple *internationalized* names?

    - by Kris Jenkins
    I've got an internationalized iPhone project. In the various ${lang}.lproj/InfoPlist.strings files I've got a single key, CFBundleName = "My App Name". That's working fine for a single target, but I can't make it work for multiple targets. I'd like to have several translated InfoPlistMyApp.strings files for the main target, plus several InfoPlistMyApp*Lite*.strings files for the lite version. But I can't figure out how to set it up. The InfoPlist.strings name seems to be set in stone, so I can't replace it dynamically. Any ideas?

    Read the article

  • Iphone xcode simulator crashes when I move up and down on a table row

    - by Frames84
    I can't get my head round this. When the page loads, everything works fine - I can drill up and down, however 'stream' (in the position I have highlighted below) becomes not equal to anything when I pull up and down on the tableview. But the error is only sometimes. Normally it returns key/pairs. If know one can understand above how to you test for // (int)[$VAR count]} key/value pairs in a NSMutableDictionary object - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *FirstLevelCell = @"FirstLevelCell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:FirstLevelCell]; if(cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:FirstLevelCell] autorelease]; } NSInteger row = [indexPath row]; //NSDictionary *stream = (NSDictionary *) [dataList objectAtIndex:row]; NSString *level = self.atLevel; if([level isEqualToString:@"level2"]) { NSMutableDictionary *stream = [[NSMutableArray alloc] init]; stream = (NSMutableDictionary *) [dataList objectAtIndex:row]; // stream value is (int)[$VAR count]} key/value pairs if ([stream valueForKey:@"title"] ) { cell.textLabel.text = [stream valueForKey:@"title"]; cell.textLabel.numberOfLines = 2; cell.textLabel.font =[UIFont systemFontOfSize:10]; NSString *detailText = [stream valueForKey:@"created"]; cell.detailTextLabel.numberOfLines = 2; cell.detailTextLabel.font= [UIFont systemFontOfSize:9]; cell.detailTextLabel.text = detailText; NSString *str = @"http://www.mywebsite.co.uk/images/stories/Cimex.jpg"; NSData *imageURL = [[NSData alloc] initWithContentsOfURL:[NSURL URLWithString:str]]; UIImage *newsImage = [[UIImage alloc] initWithData:imageURL]; cell.imageView.image = newsImage; [stream release]; } } else { cell.textLabel.text = [dataList objectAtIndex:row]; } return cell; } Thanks for your time

    Read the article

  • From xcode not able to execute DISTINCT keyword for sqlite

    - by mac
    -(void) readProductsFromDatabase { // Setup the database object sqlite3 *database; // Init the animals Array products = [[NSMutableArray alloc] init]; // Open the database from the users filessytem if(sqlite3_open([databasePath UTF8String], &database) == SQLITE_OK) { NSLog(@"db opened"); // Setup the SQL Statement and compile it for faster access const char *sqlStatement = "SELECT DISTINCT productname FROM iphone "; sqlite3_stmt *compiledStatement; if(sqlite3_prepare_v2(database, sqlStatement, -1, &compiledStatement, NULL) == SQLITE_OK) { // Loop through the results and add them to the feeds array while(sqlite3_step(compiledStatement) == SQLITE_ROW) { NSLog(@"inside sqlite3 prepare"); // Read the data from the result row NSString *aName = [NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 2)]; } } // Release the compiled statement from memory sqlite3_finalize(compiledStatement); } sqlite3_close(database); } My problem is const char *sqlStatement = "SELECT DISTINCT productname FROM iphone "; This line not executing ,i am using sqlite3, thanks in advance,

    Read the article

  • Xcode / iPhone Enterprise Distribution Certificate Made By Other Person

    - by ort11
    There is an Enterprise Distribution Provision that was created by another person that is no longer here (before me). Getting the development provision / certificate was fine, by adding myself to the team, etc. But what is the best way to clear the "No Valid / Matching Certificate" for the Distribution Provision when building for release / distribution? Will we have to make another Distribution Provision?

    Read the article

  • Xcode 4.2 MultiView App

    - by doc92606
    i am a fairly new iOS programmer, and I've lately been having trouble with my multi view app. Im using a paged based application with two view. I just don't seem to be able to make an IBAction that allows me to switch between each view. i tried using: [self presentModalViewController: SecondViewController animated: YES]; but i keep getting an error that says: "use of undeclared identifier 'SecondViewController'

    Read the article

  • how to create a auto-incremented attribute in xcode managed object model

    - by Mausimo
    Hey, what i want to do is to make a int that will be the ID of the entity and auto increment itself whenever a new entity is added (just like a SQL identity property). Is this possible? i tried using indexed (checked on attribute) however there is no description to what indexed even does. EDIT: I am adding annotations to a map, when you click the pin the annotationview with a chevron shows up. Now when you click this button i would like to load an associated picture. However the only way i know how to link the picture to this button is to give the picture a unique id, and then set the button.tag to this id and then load based on the button.tag.

    Read the article

  • Xcode debugger showing assembler for nested classes in a static library

    - by Massif
    I have a project A which creates a static library. I have a project B which uses this library. When I am debugging project B, certain functions within project A will display assembler when stepped into or when a breakpoint set inside them is hit. In the debug navigator, the line containing the function is grey instead of black. The strange part is that other functions in the same source file have no problems displaying. The thing that all these functions seem to have in common is that they belong to nested classes. However, I'm not totally convinced that this is the issue since functions from other nested classes display correctly. Does anyone know the cause of this?

    Read the article

  • How to have Xcode find the newest version of a file

    - by Arian
    Currently I have a SQLite database, that is set statically to use database01.sqlite... but what I need is a way to have the file path find the newest version of the database file that exists. For example: If a database file of database04.sqlite is available, it should use that one instead. Below is my current code: NSString *databaseDirectory = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0]; NSString *filePath = [databaseDirectory stringByAppendingPathComponent:@"database01.sqlite"];

    Read the article

  • XCode Obj-C: Make new NSArray from one key each out of an Array of Dictionaries

    - by user323772
    This actually could be a multipart question. But here's the first part ... I have an array (actually in a plist) of dictionaries. Each dictionary has 3 keys in it: (title), (points), and (description). I am trying to make a NEW array with the values of the key "title" from each dictionary in that first array. Let me explain WHY I am doing this and maybe that will provide a better all around explanation. I am trying to let people pick from a pre-determined list. Heck, if this was a web page it would be very simple since all I really care about are the "points" and the "Title". On a web site I could simply do a drop down combo-box with the "points" being the value and the title being the text for each row. But this is not a web page. So what I am trying to do here is pop out a modal picker when they click the text field. The modal picker shows the alphabetical ordered "titles" from our new array. And whichever one they select, it closes the modal view and assigns that "title" text to the UITextField which cannot be edited by the user. I have some code to get my modal picker to pop out. But I need to feed it an array of just the "titles" of each dictionary in my real array. Thanks in advance (and yes I am a newbie)

    Read the article

  • XCode iPhone OS Deployment Target Tool

    - by Trah Divad
    Problem I'm currently stuck trying to figure out what "iPhone OS Deployment Target" setting to use. I do not want to write conditional code right now, so I'd like the lowest version that runs my application fine. At first I thought it would be 2.0 as I wasn't using any 3.0 features, but then i realized that AVAudioRecorder is a 3.0 API. I don't want to be manually checking EVERY function I use in the documentation. Question Is there a tool that will check the OS availability of each functions you call in your code to figure out what the Deployment Target should be? That tool could be a good old compiler, but the latest version of the iPhone SDK does not come with the PRE-3.0 SDKs.

    Read the article

  • [multiple issues] Customizing Xcode [fonts, code sense, and more]

    - by wwrob
    How can I make code completion case-sensitive? How can I make Ctrl-k kill the content of the line and the new line character? How can I make backspace always delete only one character, no matter what it is? Right now, it deletes spaces in chunks equal to my indent level. How to change the indentation style in file templates? I like to have the opening brace on its own line. How can I make the font aliased? EDIT: Issues 4 and 5 are solved. 1 through 3 are still open.

    Read the article

  • Adding a Main Menu to a Game in Xcode

    - by MasenB
    I am about done with an Objective - C Sprite Kit Development course on Lynda, and I wanted to expand on the app the course had me make! It was made so that once I open the app, it started brick breaker, and then there are more classes for additional scenes like Game Over and Restart! I was wondering if someone could tell me how to make a Main Menu view controller that came before the Brick Breaker screen! Thanks, Masen

    Read the article

  • Remote debug a linux app from XCode

    - by erick2red
    hey guys: it's simple i had this linux pc which i connect remote and i have this application that i run there and i want to debug it, but i just don't know how. It's the simpler c++ app on the world, load some libraries, do some calculus, print some output and return, It's just that, i just haven't any clue. So any help would be appreciated. Thxs anyway

    Read the article

  • Problem getting size of Website Xcode

    - by Michael Amici
    When i try and compile I come up with a warning that reads initialization makes pointer from integer without a cast. No clue why. I am just trying to get the size of a website. #import "Lockerz_RedemptionViewController.h" @implementation Lockerz_RedemptionViewController -(IBAction)startLoop:(id) sender { NSData *dataNew = [NSData dataWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:@"http://www.google.com/"]]]; NSUInteger *len = [dataNew length]; //error is here NSLog(@"%@", len); }

    Read the article

  • iPhone xcode - Best way to control audio from several view controllers

    - by Are Refsdal
    Hi, I am pretty new to iPhone programming. I have a navBar with three views. I need to control audio from all of the views. I only want one audio stream to play at a time. I was thinking that it would be smart to let my AppDelegate have an instance of my audioplaying class and let the three other views use that instance to control the audio. My problem is that I don´t know how my views can use the audioplaying class in my AppDelegate. Is this the best approach and if so, how? Is there a better way?

    Read the article

  • Xcode: iPhone screenshots no longer work

    - by Chris Newman
    I can't be sure when this stopped working because I haven't used it for a while, but it was possibly since I upgraded to the 3.2 SDK. In Organizer, when I select the "Screenshots" tab and press "Capture", nothing happens. I've tried this with three different devices and I've restarted my Mac. What's happened, and how can I fix it?

    Read the article

  • How to set Main Inerface in xCode programatically

    - by Tom Tallak Solbu
    I am using Apples MultipleDetailViews http://developer.apple.com/library/ios/#samplecode/MultipleDetailViews/Introduction/Intro.html for template as a source for my iPad app. The template is using a splitviewController in the interface builder (MainWindow). In the iPhone/iPad Deployment info of the target, MainWindow is set as the "Main Interface". I want my app to also run on iPhone. This means I need to load a different xib when the app is run on an iPhone. I must then remove "MainWindow" from "Main Interface" because the app will crash when I load on an iPhone due to the splitViewController. The AppDeleagte of the template look like this: - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; self.window.rootViewController = self.splitViewController; [self.window makeKeyAndVisible]; } If I remove "Main Window" from "Main Interface", how do I then need to change the APpDelegate, or maybe I need to change the MainWindow.xib to also work for iPhone?

    Read the article

  • xCode Adding two arrays together

    - by Frames84
    I call two feeds that both return an NSMutableArray, I then need to make the two arrays into one. NSMutableArray *array1 = [JSONWrapper downloadFeed]; NSMutableArray *array2 = [JSONWrapper downloadFeed]; // something like: array1 += array2 Thanks

    Read the article

  • Converting byte array to image in xcode?

    - by arizah
    I am getting a byte array(I reckon) in NSMutableArray's object.The NSMutableArray i get is from Xml parsing from a service URL..Now I need to convert that byte array to UIImage ..Gone through google and found to convert to NSData and then UIImage but couldn't understand how..? How can I do it ? My array looks like this : ( { Name = "John"; Image = "/9j/4AAQSkZJRgABAQAAAQABAAD//gA7Q1JFQVRPUjogZ2QtanBlZyB2MS4wICh1c2luZyBJS kcgSlBFRyB2NjIpLCBxdWFsaXR5ID0gODAK/9sAQwAGBAUGBQQGBgUGBwcGCAoQCgoJCQoUDg8MEBcUGBgXF BYWGh0lHxobIxwWFiAsICMmJykqKRkfLTAtKDAlKCko/9sAQwEHBwcKCAoTCgoTKBoWGigoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgo/8AAEQgEKwZAAwEiAAIRAQMRAf/........ //big byte array } ) First of all I need to clear whether it is a byte array ?How can I extract image from this ?

    Read the article

< Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >