Search Results

Search found 3754 results on 151 pages for 'ios simulator'.

Page 71/151 | < Previous Page | 67 68 69 70 71 72 73 74 75 76 77 78  | Next Page >

  • Issue with GCD and too many threads

    - by dariaa
    I have an image loader class which provided with NSURL loads and image from the web and executes completion block. Code is actually quite simple - (void)downloadImageWithURL:(NSString *)URLString completion:(BELoadImageCompletionBlock)completion { dispatch_async(_queue, ^{ // dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^{ UIImage *image = nil; NSURL *URL = [NSURL URLWithString:URLString]; if (URL) { image = [UIImage imageWithData:[NSData dataWithContentsOfURL:URL]]; } dispatch_async(dispatch_get_main_queue(), ^{ completion(image, URLString); }); }); } When I replace dispatch_async(_queue, ^{ with commented out dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^{ Images are loading much faster, wich is quite logical (before that images would be loaded one at a time, now a bunch of them are loading simultaneously). My issue is that I have perhaps 50 images and I call downloadImageWithURL:completion: method for all of them and when I use global queue instead of _queue my app eventually crashes and I see there are 85+ threads. Can the problem be that my calling dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0) 50 times in a row makes GCD create too many threads? I thought that gcd handles all the treading and makes sure the number of threads is not huge, but if it's not the case is there any way I can influence number of threads?

    Read the article

  • Minimum and maximum Date in date Picker in iphone

    - by Iphony
    I want to get minimum and maximum date from date picker but minimum date should be "- 18" of current date and maximum date should be "- 100" of current date. Suppose current year is 2018 then I want minimum date 2000 and maximum date 1918. what I have done so far is : NSCalendar *gregorian = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar]; NSDateComponents *components = [gregorian components:NSYearCalendarUnit fromDate:[NSDate date]]; NSInteger year = [components year]; int mindt = year - 18; int maxdt = year -100; // NSDate * MinDate = [components year] - 18; // NSDate * MaxDate = [components year] - 100; // self.datePicker.minimumDate = MinDate; // self.datePicker.maximumDate = MaxDate; but I cant get this integer to my date formate.. pls suggest any way ...

    Read the article

  • Objective C: Using UIImage for Stroking

    - by SeongHo
    I am trying to apply a texture for my brush but i'm really having a hard time figuring how it is done. Here's the image of my output. I used an UIImage that just follows the touch on the screen but when i swipe it faster the result is on the right side "W", and on the left side that's the result when i swipe it slow. i tried using the CGContextMoveToPoint and CGContextAddLineToPoint i don't know how apply the texture. Is it possible to use UIImage for the stroke texture? Here's my code UIImage * brushImageTexture = [UIImage imageNamed:@"brushImage.png"]; [brushImagetexture drawAtPoint:CGPointMake(touchCurrentPosition.x, touchVurrentPosition.y) blendMode:blendMode alpha:1.0f];

    Read the article

  • NSPredicate always gives back the same data

    - by Stef Geelen
    I am trying to work with NSPredicates. But it always give me back the same array. Here you can see my predicate. NSFetchRequest *request = [[NSFetchRequest alloc] init]; NSPredicate *predicate = [NSPredicate predicateWithFormat:@"whichAlbum.album_id == %d", AlbumId]; [request setEntity:[NSEntityDescription entityForName:@"Picture" inManagedObjectContext:self.genkDatabase.managedObjectContext]]; [request setPredicate:predicate]; Also when I try it hardcoded. It gives back the same array. NSPredicate *predicate = [NSPredicate predicateWithFormat:@"whichAlbum.album_id == 5"]; Here you can see my database model. And here you can see how I put data in my database for entity Picture. + (Picture *)pictureWithGenkInfo:(NSDictionary *)genkInfo inManagedObjectContext:(NSManagedObjectContext *)context withAlbumId:(int)albumId withPictureId:(int)pictureId; { Picture *picture = nil; picture = [NSEntityDescription insertNewObjectForEntityForName:@"Picture" inManagedObjectContext:context]; picture.url = [genkInfo objectForKey:PICTURES_URL]; picture.pic_album_id = [NSNumber numberWithInt:albumId]; picture.picture_id = [NSNumber numberWithInt:pictureId]; return picture; } Anybody can help me ? Kind regards

    Read the article

  • Logging in to website with saved username and password

    - by DGund
    One of the functions of an app I am making involves logging the user into our Campus Portal website. For ease of use, the user may enter a username and password into the app once, and it will be saved for all future log-ins. When the user clicks a button, the information will automatically be sent to log in, and the website will be displayed in a UIWebView. Let us say that the username and password are each stored in an NSString. How can I use this data to log in to this website programmatically and display the page it in a UIWebView? I know little about posting and forms, so any help is appreciated. Would something like this Stackoverflow answer help? Here's the shell of my code for this - (IBAction)btnGo:(id)sender { username = usernameField.text; password = passwordField.text; if (saveSwitch.isOn) { //Save data if the user wants AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate]; usernameSaved = username; passwordSaved = password; [appDelegate.listOfPortalCredentials replaceObjectAtIndex:0 withObject:usernameSaved]; [appDelegate.listOfPortalCredentials replaceObjectAtIndex:1 withObject:passwordSaved]; } //Insert username and password to web form, log in to portal //This is where I need help }

    Read the article

  • UIBezierPath too many paths = too slow?

    - by HHHH
    I have a loop in which I'm adding many (10000+) lines to a UIBezierPath. This seems to be fine, but once I try and render the bezierpath, my device becomes extremely slow and jerky. Is this because I've added too many lines to my path? Adding lines to UIBezierPath - simplified: (this seems fine) [path moveToPoint:CGPointZero]; for (int i = 0; i < 10000; i++ ) { [path addLineToPoint:CGPointMake(i, i)]; } Rendering BeizerPath (Suggested by Rob) - this seems slow. - (void)drawBezierAnimate:(BOOL)animate { UIBezierPath *bezierPath = path; CAShapeLayer *bezier = [[CAShapeLayer alloc] init]; bezier.path = bezierPath.CGPath; bezier.strokeColor = [UIColor blueColor].CGColor; bezier.fillColor = [UIColor clearColor].CGColor; bezier.lineWidth = 2.0; bezier.strokeStart = 0.0; bezier.strokeEnd = 1.0; [self.layer addSublayer:bezier]; if (animate) { CABasicAnimation *animateStrokeEnd = [CABasicAnimation animationWithKeyPath:@"strokeEnd"]; animateStrokeEnd.duration = 100.0; animateStrokeEnd.fromValue = [NSNumber numberWithFloat:0.0f]; animateStrokeEnd.toValue = [NSNumber numberWithFloat:1.0f]; [bezier addAnimation:animateStrokeEnd forKey:@"strokeEndAnimation"]; } } Qs: 1) Is this because I'm adding too many paths too quickly? 2) I want to eventually draw many different lines of different colors, so I assume I would need to create multiple (10000+) UIBezierPaths - would this help or greatly slow the device as well? 3) How would I get around this? Thanks in advance for your help.

    Read the article

  • iPhone Application failing to come back from sigkill

    - by overscore
    I have no idea if this is intended behaviour, but whenever the application exits (say, the user is double-clicking the home button and pressing on the red dash on the icon) I get the dreaded SIGKILL. Now, when I try to launch the app again all I get is the old screen state and a frozen (I presume ?) program. It could be because of clunky memory management, but NSZombieEnabled doesn't seem to agree. Any thoughts ?

    Read the article

  • Navigating between 2 ViewControllers

    - by Kobe.o4
    Im using Navigation Controller for my ViewControllers,I set my importantViewController as something like this to be its RootView: UINavigationController *navControl = [[UINavigationController alloc] initWithRootViewController: vc]; [self presentModalViewController: navControl animated: YES]; Then, I pushView anotherView the FrontViewController like this: [self.navigationController pushViewController:vc animated:YES]; After a button is pressed in FrontViewController another view will be pushed ViewA but it is connected with another ViewController ViewB the same way as this AGAIN: [self.navigationController pushViewController:vc animated:YES]; (Which I think Im doing wrong when dismissing either of them with [self.navigationController popViewControllerAnimated:YES];) This is an illustration: My problem is, I need to navigate between View A and View B then when I dismiss either of them it will got back to FrontViewController. Like a child of a child View. Thanks.

    Read the article

  • Sorting an NSArray of NSString

    - by Robert Eisinger
    Can someone please show me the code for sorting an NSMutableArray? I have the following NSMutableArray: NSMutableArray *arr = [[NSMutableArray alloc] init]; with elements such as "2", "4", "5", "1", "9", etc which are all NSString. I'd like to sort the list in descending order so that the largest valued integer is highest in the list (index 0). I tried the following: [arr sortUsingSelector:@selector(compare:)]; but it did not seem to sort my values properly. Can someone show me code for properly doing what I am trying to accomplish? Thanks!

    Read the article

  • synchronously load html content in UIWebView

    - by mbg1987
    im using a UIWebView to show html content in my app, the app contains two arrows to navigate between topics just like a RSS reader app, but when the user hits up or down arrow, the next topic doesn't show up until the data come back and the user still able to interact with the UI which is a bit confusing, My question: how to block the UI when user moves to the next/back topic ? in other words how to make loadHTMLString:baseURL: works as a synchronous calling ? thanks !

    Read the article

  • Delete/move a UITableView row that's attached to a web service.

    - by Kevin L.
    Deleting or moving rows for a UITableView that is backed with local data (e.g., NSArray) is easy and instantaneous: Remove the value from the array. Call deleteRowsAtIndexPaths:withRowAnimation:. Profit! But my table view communicates with a web service, which means once the "Delete" button on that row gets tapped, I have to forward a request on to the server (via ASIHTTPRequest, of course), get the response, and then tell the table view to run its little delete-row animation, all with a few seconds of latency in between. From a high-level, what's the best way to do that? Throw some callback selector into ASIHTTPRequest's userInfo dictionary? KVO? Bonus points for some nice UI touch, like some kind of spinner on the soon-to-be-deleted cell.

    Read the article

  • UIPageViewController blanking page

    - by CrazyEoin
    I've been trying to use the UIPageViewController to display 3 different nibs for a few days on and off now and have almost got it working. I still have one weird bug that I cant figure out. Basically the app starts, I can scroll between the 3 pages one after another with out any problems, eg: Page1-Page2-Page3 and then back to the start: Page3-Page2-Page1. No Problems. The issue is that if I scroll, for example from Page3-Page2, then BACK to Page3, Page3 Dissappears when it snaps into place. If I scroll to where a forth page would be, then I get Page3. Here is the code relevant to the UIPageViewController, the nibs and the delegate methods for the UIPageViewController: - (void)viewDidLoad{ [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. self.pageViewController = [[UIPageViewController alloc] initWithTransitionStyle:UIPageViewControllerTransitionStyleScroll navigationOrientation:UIPageViewControllerNavigationOrientationHorizontal options:nil]; self.pageViewController.delegate = self; [[self.pageViewController view] setFrame:[[self view] bounds]]; indexTest = 0; Page1 *p1 = [[Page1 alloc]initWithNibName:@"Page1" bundle:nil]; p1.view.tag = 1; Page2 *p2 = [[Page2 alloc]initWithNibName:@"Page2" bundle:nil]; p2.view.tag = 2; Page3 *p3 = [[Page3 alloc]initWithNibName:@"Page3" bundle:nil]; p3.view.tag = 3; NSArray *arr = [[NSArray alloc] initWithObjects:p1,nil]; viewControllers = [[NSMutableArray alloc] initWithObjects:p1,p2,p3, nil]; [self.pageViewController setViewControllers:arr direction:UIPageViewControllerNavigationDirectionForward animated:NO completion:nil]; self.pageViewController.dataSource = self; [self addChildViewController:self.pageViewController]; [[self view] addSubview:[self.pageViewController view]]; [self.pageViewController didMoveToParentViewController:self]; self.view.gestureRecognizers = self.pageViewController.gestureRecognizers; } #pragma mark - page view controller stuff - (UIViewController *)pageViewController:(UIPageViewController *)pageViewController viewControllerBeforeViewController:(UIViewController *)viewController { if (indexTest > 0) { switch (indexTest) { case 1:{ NSLog(@"NO page is BEFORE current page"); break; } case 2:{ NSLog(@"Page BEFORE is Page: %@", [NSString stringWithFormat:@"%@",[viewControllers objectAtIndex:0] ] ); indexTest--; return [viewControllers objectAtIndex:0]; break; } default:{ NSLog(@"PROBLEM in viewBEFORE, indexTest = %d!!!!", indexTest); break; } } } return nil; } - (UIViewController *)pageViewController:(UIPageViewController *)pageViewController viewControllerAfterViewController:(UIViewController *)viewController { if (indexTest < NUM_OF_PAGES) { switch (indexTest) { case 0:{ NSLog(@"Page AFTER is Page: %@", [NSString stringWithFormat:@"%@",[viewControllers objectAtIndex:1] ] ); indexTest++; return [viewControllers objectAtIndex:1]; break; } case 1:{ NSLog(@"Page AFTER is Page: %@", [NSString stringWithFormat:@"%@",[viewControllers objectAtIndex:2] ] ); indexTest++; return [viewControllers objectAtIndex:2]; break; } case 2:{ NSLog(@"No pages AFTER this current page %d", indexTest); break; } default:{ NSLog(@"PROBLEM in viewAFTER, indexTest = %d!!!!", indexTest); break; } } } return nil; } Finally the page index dots code #pragma mark - dot controller - (NSInteger)presentationCountForPageViewController:(UIPageViewController *)pageViewController { // The number of items reflected in the page indicator. return NUM_OF_PAGES; } - (NSInteger)presentationIndexForPageViewController:(UIPageViewController *)pageViewController { // The selected item reflected in the page indicator. return 0; } Any and all help is much appreciated, I think I'm just doing something silly that I cant see as I'm so close to it fully working. If anythings not clear or I haven't give enough information please let me know and I'll answer it as best as I can. Thanks

    Read the article

  • Editing key inside array item - plist

    - by F0u4d
    I have the following plist: <plist version="1.0"> <dict> <key>General</key> <dict> <key>Table 1</key> <array> <dict> <key>subheadingName</key> <string>Item 1 of table 1</string> <key>subheadingDetail</key> <string>details about item 1</string> </dict> <dict> <key>subheadingName</key> <string>Item 2 of table 1</string> <key>subheadingDetail</key> <string>details about item 2!</string> </dict> <dict> <key>subheadingName</key> <string>Item 3 of table 1</string> <key>subheadingDetail</key> <string>details about item 3!</string> </dict> </array> </dict> <key>Table 2</key> <dict> <key>subheadingArr</key> <array> <dict> <key>subheadingName</key> <string>Item 1 of table 2</string> <key>subheadingDetail</key> <string>details about item 1</string> </dict> <dict> <key>subheadingName</key> <string>Item 2 of table 2</string> <key>subheadingDetail</key> <string>details about item 2!</string> </dict> <dict> <key>subheadingName</key> <string>Item 3 of table 2</string> <key>subheadingDetail</key> <string>details about item 3!</string> </dict> </array> </dict> </dict> </plist> I am trying to write and read the I have made these 2 methods trying to read and write subheadingDetail for a specific subheadingName but they are wrong/incomplete and can't manage to get it work. -(void)updateInfo:(NSString *)info forSubHeadingName:(NSString *)subheadingName { NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSString *path = [documentsDirectory stringByAppendingPathComponent:@"DeviceInformation.plist"]; NSMutableDictionary *data = [[NSMutableDictionary alloc] initWithContentsOfFile:path]; [data setObject:info forKey:subheadingName]; [data writeToFile:path atomically:YES]; } -(NSString *)readInfoForSubHeadingName:(NSString *)subheadingName { NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSString *path = [documentsDirectory stringByAppendingPathComponent:@"DeviceInformation.plist"]; NSMutableDictionary *data = [[NSMutableDictionary alloc] initWithContentsOfFile:path]; return [data objectForKey:subheadingDetail]; } Tried searching around the answers, but couldn't find anything similar to my issue. Thanks in advance.

    Read the article

  • Missing Localized Screenshots Error on itunes

    - by Arvind
    I have selected Default Language as "Australian English" as Default language. When I am submitting the binary it showing as rejected"Red Icon" with status "Missing Localized Screenshots". The application is in only single language. I have added screen shots also the application is only for iphone. When I am looking binary information that is showing as: Localizations : ( "en-AU" ) Please suggest me where I am making mistake.

    Read the article

  • UIRotationGestureRecognizer changes with CGAffineTransformMakeScale

    - by user523234
    A view is flipped using this: self.transform = CGAffineTransformMakeScale(-1, 1); // self is an UIView To rotate this view: -(void)handleRotate:(UIRotationGestureRecognizer *)recognizer { recognizer.view.transform = CGAffineTransformRotate(recognizer.view.transform, recognizer.rotation); recognizer.rotation = 0; } The issue is that after the view is flipped so is the rotation's direction. Any solution how to fix this? Edit: My current solution is using a boolean and negate the recognizer.rotation value in handleRotate method. But I am still looking for the technical solution.

    Read the article

  • Link a programmatic instantiation of class x in class y to a view controller of class x

    - by Joel Derfner
    I have classes Compose and Haiku, each connected to a view controller in IB. Haiku is instantiated in Compose as ghhaiku. Haiku has an array, self.arrayOfHaiku, with 117 members. But in Compose, self.ghhaiku.arrayOfHaiku has no members. I think the problem is that I haven't linked the instance of Haiku that has the 117-member array with the instance of Haiku created in Compose. But how do I do that? (I could of course be totally wrong and the problem could be something else, but that seems to make intuitive sense.) Any thoughts?

    Read the article

  • Reducing lag when downloading large amount of data from webpage

    - by Mahir
    I am getting data via RSS feeds and displaying each article in a table view cell. Each cell has an image view, set to a default image. If the page has an image, the image is to be replaced with the image from the article. As of now, each cell downloads the source code from the web page, causing the app to lag when I push the view controller and when I try scrolling. Here is what I have in the cellForRowAtIndexPath: method. NSString * storyLink = [[stories objectAtIndex: storyIndex] objectForKey: @"link"]; storyLink = [storyLink stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; NSString *sourceCode = [NSString stringWithContentsOfURL:[NSURL URLWithString:storyLink] encoding:NSUTF8StringEncoding error:&error]; NSString *startPt = @"instant-gallery"; NSString *startPt2 = @"<img src=\""; if ([sourceCode rangeOfString:startPt].length != 0) { //webpage has images // find the first "<img src=...>" tag starting from "instant-gallery" NSString *trimmedSource = [sourceCode substringFromIndex:NSMaxRange([sourceCode rangeOfString:startPt])]; trimmedSource = [trimmedSource substringFromIndex:NSMaxRange([trimmedSource rangeOfString:startPt2])]; trimmedSource = [trimmedSource substringToIndex:[trimmedSource rangeOfString:@"\""].location]; NSURL *url = [NSURL URLWithString:trimmedSource]; NSData *data = [NSData dataWithContentsOfURL:url]; UIImage *image = [UIImage imageWithData:data]; cell.picture.image = image; Someone suggested using NSOperationQueue. Would this way be a good solution? EDIT: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *MyIdentifier = @"FeedCell"; LMU_LAL_FeedCell *cell = [tableView dequeueReusableCellWithIdentifier:MyIdentifier]; if (cell == nil) { NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"LMU_LAL_FeedCell" owner:self options:nil]; cell = (LMU_LAL_FeedCell*) [nib objectAtIndex:0]; } int storyIndex = [indexPath indexAtPosition: [indexPath length] - 1]; NSString *untrimmedTitle = [[stories objectAtIndex: storyIndex] objectForKey: @"title"]; cell.title.text = [untrimmedTitle stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]]; CGSize maximumLabelSize = CGSizeMake(205,9999); CGSize expectedLabelSize = [cell.title.text sizeWithFont:cell.title.font constrainedToSize:maximumLabelSize]; //adjust the label to the the new height. CGRect newFrame = cell.title.frame; newFrame.size.height = expectedLabelSize.height; cell.title.frame = newFrame; //position frame of date label CGRect dateNewFrame = cell.date.frame; dateNewFrame.origin.y = cell.title.frame.origin.y + cell.title.frame.size.height + 1; cell.date.frame = dateNewFrame; cell.date.text = [self formatDateAtIndex:storyIndex]; dispatch_queue_t someQueue = dispatch_queue_create("cell background queue", NULL); dispatch_async(someQueue, ^(void){ NSError *error = nil; NSString * storyLink = [[stories objectAtIndex: storyIndex] objectForKey: @"link"]; storyLink = [storyLink stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; NSString *sourceCode = [NSString stringWithContentsOfURL:[NSURL URLWithString:storyLink] encoding:NSUTF8StringEncoding error:&error]; NSString *startPt = @"instant-gallery"; NSString *startPt2 = @"<img src=\""; if ([sourceCode rangeOfString:startPt].length != 0) { //webpage has images // find the first "<img src=...>" tag starting from "instant-gallery" NSString *trimmedSource = [sourceCode substringFromIndex:NSMaxRange([sourceCode rangeOfString:startPt])]; trimmedSource = [trimmedSource substringFromIndex:NSMaxRange([trimmedSource rangeOfString:startPt2])]; trimmedSource = [trimmedSource substringToIndex:[trimmedSource rangeOfString:@"\""].location]; NSURL *url = [NSURL URLWithString:trimmedSource]; NSData *data = [NSData dataWithContentsOfURL:url]; UIImage *image = [UIImage imageWithData:data]; dispatch_async(dispatch_get_main_queue(), ^(void){ cell.picture.image = image; }); }) //error: expected expression } return cell; //error: expected identifier } //error extraneous closing brace

    Read the article

  • didSelectRowAtIndexPath being called after viewDidLoad of the called view

    - by Serguei Fedorov
    I am trying to pass variables over to the new view. I have the following code: appDelegate *dataCenter = (AppDelegate*)[[UIApplication sharedApplication] delegate]; dataCenter.myVariable = [array objectAtIndex:indexPath.row]; in the didSelectRowAtIndexPath of the calling view. However, the issue that I have is that this variable is empty in the vewDidLoad function of the next view, simply because it fired off BEFORE the didSelectRowAtIndexPath of the calling view. I am using storyboard to link the views together. Both are UITableView. If I hit back and then reselect the table element it is then set, granted that by the time I hit back and then selected again, the variable got set. Is there any way to for the order of execution? I really don't want to do UI view switching on the back end. Any help is greatly appreciated!

    Read the article

  • NSUserDefaults with in-app Settings bundle

    - by Hema Vasudevan
    I'm in the process of building an app and would prefer to have an in-app specific Settings bundle rather than make it available in the Settings application. I'm using NSUserDefaults class to save and retrieve them but would like to have the same Settings app look and feel. I wanted to use InAppSettingsKit or the llamasettings but don't know how to use the NSUserDefaults class. Those kits tell me how to create a .plist file and use their kits. All I need is use the Settings app look and feel while at the same time use NSUserDefaults class to save and retrieve values. Please help.

    Read the article

  • iPhone/iPad fatal error in C++ code produces no output in the log

    - by morgancodes
    I'm trying to move away from Objective-C to C++ for audio in my iPad programming, due to the a few reports I've heard of Objective-C selectors sometimes causing audio glitches. So I'm starting to use pure C++ files. When a fatal error happens in one of the C++ files, I get no output from the log. The app just crashes. For example, if I do this in my C++ file: env = new ADSR(); cout << "setting env to null\n"; env = NULL; env->setSustainLevel(1); cout << "called function on non-initialized env\n"; I get the following output: setting env to null After that, there's a method called on NULL, which apparently kills the app, but absolutely nothing to that effect is reported. What do I need to do to have useful information logged when there's an error in my C++ code?

    Read the article

  • UILabel with custom font displays *wrong* custom font

    - by winsmith
    I'm using this method to embed custom fonts in my iPhone app. The embedding works: When I run the following code, the fonts are listed. (Currently, I'm embedding all family members of Myriad Pro in OTF format) for( NSString *familyName in [UIFont familyNames] ){ for( NSString *fntName in [UIFont fontNamesForFamilyName:familyName] ){ NSLog(@"%@", fntName); }} When I try to set the font of a label to MyriadPro or MyriadPro-Bold, this works just as expected. However, when I set the font to MyriadPro-BoldCond, the label is still set in MyriadPro-Bold instead of the condensed version. (The font names are correct, I checked.) My Code: [recommendationLabel setFont:[UIFont fontWithName:@"MyriadPro-BoldCond" size:140]]; recommendationLabel.adjustsFontSizeToFitWidth = YES; What's the deal?

    Read the article

  • UIWebView appears null when calling fro a method

    - by Alexidze
    I have a major problem when trying to access a UIWebView that was created during ViewDidLoad, the UIWebView appears null here is how i declare the property @property (nonatomic, retain) UIWebView *detailsView; the implementation @implementation iPadMainViewController @synthesize detailsView; - (void)viewDidLoad { [super viewDidLoad]; detailsView = [[UIWebView alloc] initWithFrame:CGRectMake(500, 0, 512, 768)]; [self.view addSubView:detailsView]; } When accessing from - (void)loadDetailedContent:(NSString *)s { NSLog(@"%@", detailsView); } I get NULL, is it a normal behavior or am i doing something wrong? here is the touchesBegan that is being called, from the views subclass that is being touched, -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { iPadMainViewController *mycontroller = [[iPadMainViewController alloc] init]; self.delegate = mycontroller; [self.delegate loadDetailedContent:NewsId]; }

    Read the article

  • UIWebView load remote html page with local images and javascript files

    - by BlueNile
    Im creating application that will display remote page on the UIWebView using local images and javascript/css files for faster loading. I want to avoid using cache because for this to work it must first load all the content. I was searching online for possible solution. Here is what I have: NSURLRequest *urlrequest = [ [NSURLRequest alloc] initWithURL: [NSURL URLWithString:urlString] ]; NSData *returnData = [ NSURLConnection sendSynchronousRequest:urlrequest returningResponse: nil error: nil ]; NSString *HTMLData = [[NSString alloc] initWithData:returnData encoding:NSUTF8StringEncoding]; NSString *resourcePath = [[NSBundle mainBundle] resourcePath]; resourcePath = [resourcePath stringByReplacingOccurrencesOfString:@"/" withString:@"//"]; resourcePath = [resourcePath stringByReplacingOccurrencesOfString:@" " withString:@"%20"]; [webView loadHTMLString:HTMLData baseURL: [NSURL URLWithString: [NSString stringWithFormat:@"file:/%@//",resourcePath] ]]; urlString is defined and I moved files to the app bundle. Code works as I can see the remote page but no images nor javascript files are present.

    Read the article

  • Breaking One Big Graphic of MutablePaths into CAShapeLayers

    - by StackOverFlowRider
    I have a class called GraphicView that takes a Graphic object and draws it in its drawRect method. This Graphic object is basically an array of mutablePaths that comprise an icon that I want drawn. For performance and other issues, I was thinking of taking this icon that is comprised of mutablePaths, and dividing it into a bunch of CAShapeLayers. I'm wondering is this possible? Considering the points for the mutablePaths of the icon are all interwoven together (ie the icon was initially an SVG file that I converted to code), is it possible to divide different parts of the icon into CAShapeLayers, and reassemble them all together when assigning to the views layer? If so how would it be done? If I assign them as sublayers to a CALayer or CAShapeLayer, will it understand to mesh them all together?

    Read the article

  • Show a SplashScreenScene before to GameScene?

    - by lisovaccaro
    I want to add a splash screen to my game. I created a SplashScene.sks and a SplashScene.swift file. I'm trying to load my SplashScene before GameScene but I cannot manage to do it. How should I do this? This is what I'm trying now: class GameViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() let skView = self.view as SKView skView.ignoresSiblingOrder = true /* Set the scale mode to scale to fit the window */ var scene = SplashScreenScene() // Present SplashScreenScene first scene.scaleMode = .AspectFill skView.presentScene(scene) } Then on my SplashScreenScene: class SplashScreenScene: SKScene { override func didMoveToView(view: SKView) { self.size = view.bounds.size self.anchorPoint = CGPointMake(0.5, 0.5) var background = SKSpriteNode(imageNamed:"LaunchImage") self.addChild(background) // Start timer to load next scene NSTimer.scheduledTimerWithTimeInterval(1, target: self, selector: Selector("changeScene"), userInfo: nil, repeats: false) } func changeScene() { let scene = GameScene() view.presentScene(scene) } } This is very close to the solution, however for some reason when I do this my game becomes laggy (if I present GameScene directly the game runs fine).

    Read the article

< Previous Page | 67 68 69 70 71 72 73 74 75 76 77 78  | Next Page >