Search Results

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

Page 66/110 | < Previous Page | 62 63 64 65 66 67 68 69 70 71 72 73  | Next Page >

  • How can I search for a string in a .txt file for NSScanner?

    - by pixelbitapps
    I currently have the following code to get a certain piece of code from the UIWebView: NSURL *requestTimetableURL = [NSURL URLWithString:@"http://www.dhsb.org/index.phtml?d=201435"]; NSLog(@"Loaded Timetable"); NSError *error; NSString *page = [NSString stringWithContentsOfURL:requestTimetableURL encoding:NSASCIIStringEncoding error:&error]; [webView loadHTMLString:page baseURL:requestTimetableURL]; NSString* Period1; NSScanner *htmlScanner = [NSScanner scannerWithString:page]; [htmlScanner scanUpToString:@"<P align=center><STRONG><FONT color=#c00000>" intoString:NULL]; [htmlScanner scanString:@"<P align=center><STRONG><FONT color=#c00000>" intoString:NULL]; [htmlScanner scanUpToString:@"</FONT>" intoString:&Period1]; How can I scan a .txt file (which contains the string like above) for the code? E.G. [htmlScanner scanUpToString:teststring intoString:NULL]; Thanks!

    Read the article

  • Is there any example code explaining how to change Facebooks API existing code to make it yours?

    - by Naeim
    FBStreamDialog* dialog = [[[FBStreamDialog alloc] init] autorelease]; dialog.delegate = self; dialog.userMessagePrompt = @"Example prompt"; dialog.attachment = @"{\"name\":\"Facebook Connect for iPhone\"," "\"href\":\"http://developers.facebook.com/connect.php?tab=iphone\"," "\"caption\":\"Caption\",\"description\":\"Description\"," "\"media\":[{\"type\":\"image\"," "\"src\":\"http://img40.yfrog.com/img40/5914/iphoneconnectbtn.jpg\"," "\"href\":\"http://developers.facebook.com/connect.php?tab=iphone/\"}]," "\"properties\":{\"another link\":{\"text\":\"Facebook home page\",\"href\":\"http://www.facebook.com\"}}}"; // replace this with a friend's UID // dialog.targetId = @"999999"; [dialog show]; Is there any example code explaining how to change Facebooks API existing code to make it yours? i want to change http://img40.yfrog.com/img40/5914/iphoneconnectbtn.jpg to http://img40.yfrog.com/img40/5914/%@.jpg //... , %mystring

    Read the article

  • Iphone SDK - tap to undo a zoom inside of a scroll view

    - by Dave
    Hi, I was just wondering how I can get a single tap to undo the zoom inside of a scroll view? I cant seem to figure it out. I was also wondering how do you know what size to set your scroll view contentSize, as I find this issue a little confusing at the moment I have it set at 460x320. Thanks

    Read the article

  • iPhone app not running on iPhone

    - by Jon
    I have my iPhone setup on my computer at home, with my developer account and provisioning profile. I'm trying to get it setup on my work computer so I can run work apps on it as well. My work has their own dev account. I created an app ID and privisioning profile on my personal account and downloaded it on my work computer but its not letting me compile and run on my iPhone. It says valid provisiong profile not found on executable.

    Read the article

  • Adding custom UITableViewCell crashes the simulator.

    - by nevva
    Im trying to build my application using a custom UITableViewCell. This is the code in my UIViewController that adds the viewCell to the table: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { NSLog(@"------- Tableview --------"); static NSString *MyIdentifier = @"MyIdentifier"; MyIdentifier = @"aCellIdentifier"; MyTableCell *cell = (MyTableCell *)[tableView dequeueReusableCellWithIdentifier:MyIdentifier]; if(cell == nil) { NSArray *[[NSBundle mainBundle] loadNibNamed:@"tblCellView" owner:self options:nil]; cell = tblCell; } [cell setLabelText:[NSString stringWithFormat:@"indexpath.row: %d", indexPath.row]]; //cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:MyIdentifier] autorelease]; return cell; } if i uncomment the line above "return cell" it returns a regular UITableViewCell without any errors, but as soon as i try to implement my custom cell it crashes with this error: ------- Tableview -------- 2010-04-23 11:17:33.163 SogetGolf[26935:40b] * Assertion failure in -[UITableView _createPreparedCellForGlobalRow:withIndexPath:], /SourceCache/UIKit_Sim/UIKit-984.38/UITableView.m:4709 2010-04-23 11:17:33.164 SogetGolf[26935:40b] * Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'UITableView dataSource must return a cell from tableView:cellForRowAtIndexPath:' 2010-04-23 11:17:33.165 SogetGolf[26935:40b] Stack: ( ... I have configured the .xib file as one should with the proper outlets. And the identifier of the UITableViewCell corresponds with name im trying to load from NSBundle

    Read the article

  • How to stop moving the image in objective c?

    - by user1589452
    I have done a coding to check whether the image crossed particular area or not, -(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { CGPoint loc=[touch locationInView:self.view]; if (touch.view==img2Obj) { NSLog(@"image2"); img2Obj.center=loc; currentx1=img2Obj.frame.origin.x; currenty1=img2Obj.frame.origin.y; //NSLog(@"top left corner x and y is %.1f and %.1f",img2Obj.frame.origin.x,img2Obj.frame.origin.y); [self isImg1InPos]; }} -(void)isImg1InPos { int dx,dy; dx=currentx1-x1; dy=currenty1-y1; if (abs(dx)<5 && abs(dx)<5) { NSLog(@"Image must stop moving after this!!!"); [img2Obj setUserInteractionEnabled:FALSE]; } //NSLog(@"unsigned int is %d",abs(dx)); } I want the image to stop moving when when it passes the condition. [img2Obj setUserInteractionEnabled:FALSE]; But its not working, can anyone tell me how to solve this problem Many thanks in advance

    Read the article

  • setBackButtonBackgroundImage without title IOS5

    - by user1736571
    I'm trying to get a back button without a title but I can't make it work. I am really new in objective-c... UIImage *backButtonImage = [[UIImage imageNamed:@"back.png"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 0, 30, 50)]; [[UIBarButtonItem appearance] setBackButtonBackgroundImage:backButtonImage forState:UIControlStateNormal barMetrics:UIBarMetricsDefault]; With that code I have my back button but also the title of the previous page. I found some working examples using the class UIViewController but in my case the code is in the appDelegate.m file. Any idea how I can make it work ?

    Read the article

  • how to create static line in coreplot

    - by Rémi Bédard-Couture
    I am trying to make my control lines static so instead of being displayed as part of the graph(the control lines are moving with the graph), they would be displayed like an axis the app can only scroll horizontally i'm talking about the two red line and the green line(which i put over the x axis) this is how i do my lines: // Center line CPTScatterPlot *centerLinePlot = [[CPTScatterPlot alloc] init]; centerLinePlot.identifier = kCenterLine; CPTMutableLineStyle *lineStyle = [CPTMutableLineStyle lineStyle]; lineStyle.lineWidth = 2.0; lineStyle.lineColor = [CPTColor greenColor]; centerLinePlot.dataLineStyle = lineStyle; centerLinePlot.dataSource = self; [graph addPlot:centerLinePlot]; but maybe it has something to do with the displayed range: ////////ajuste la portion a voir if(data.Resultats.count>10) { plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(data.Resultats.count - 10) length:CPTDecimalFromDouble(10)]; } plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(RangeMin) length:CPTDecimalFromDouble(RangeMax-RangeMin)]; // Adjust visible ranges so plot symbols along the edges are not clipped CPTMutablePlotRange *xRange = [plotSpace.xRange mutableCopy]; CPTMutablePlotRange *yRange = [plotSpace.yRange mutableCopy]; //place l'axe x sur la ligne de controle pour voir les WorkOrders x.orthogonalCoordinateDecimal = CPTDecimalFromDouble(center); //x.orthogonalCoordinateDecimal = yRange.location; //y.orthogonalCoordinateDecimal = xRange.location; //x.visibleRange = xRange; //y.visibleRange = yRange; //x.gridLinesRange = yRange; //y.gridLinesRange = xRange; [xRange expandRangeByFactor:CPTDecimalFromDouble(1.15)];//1.05 [yRange expandRangeByFactor:CPTDecimalFromDouble(1.15)]; plotSpace.xRange = xRange; plotSpace.yRange = yRange;

    Read the article

  • How do I make it save in x-code?

    - by Nathan
    THIS IS USING X-CODE Okay, so I've put in all of the code in order for a page to be saved in a navigation app. I've also made the table refresh once you enter the main screen, but I don't see the page pop up until the second time I come back. How can I make it so it comes up the first time I come in?

    Read the article

  • How do I make a UIAlertView happen only on the first start-up of an iPhone app?

    - by user309245
    I'm using the UIAlertView to make a pop-up happen once the app has started up. It works fine but I only want the pop up to happen on the first start-up of the app. At the moment I've got the UIAlertView in the AppDelegate class, after the application didFinishLaunching. Here is my code at the moment. - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { sleep(4); UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Welcome!" message:@"SAMPLE!!!" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]; [alert show]; [alert release]; I'm new to app development so sorry if this is simple. Thanks in advance! :)

    Read the article

  • Change certain values within method

    - by Grant Wilkinson
    I have the following code with a bool if statement inside and in another method I change the value of the bool and i know i need to recall the method [self someMethod]; but I just want to reflect the changes in the if statement and not recall everything else again, how do i do this? thanks -(void)someMethod { //start my code here if (boolvalueisTrue) { //change this part only } } -(void)changeBool { boolvalueisTrue = TRUE; [self someMethod]; //instead of calling the whole method i just want to reflect //the changes inside my if statement }

    Read the article

  • Breakpoint pointing out "objc_autoreleaseNoPool"

    - by Andrew
    So I'm debugging an app in preperation for its app so release, and I enabled a universal breakpoint for "All Exceptions". Since then, everytime I run the app, the console prints: Catchpoint 2 (throw)Pending breakpoint 1 - "objc_exception_throw" resolved objc[11765]: Object 0x8f18ff0 of class __NSCFLocale autoreleased with no pool in place - just leaking - break on objc_autoreleaseNoPool() to debug objc[11765]: Object 0x8f190a0 of class __NSCFNumber autoreleased with no pool in place - just leaking - break on objc_autoreleaseNoPool() to debug objc[11765]: Object 0x8f1fef0 of class __NSCFLocale autoreleased with no pool in place - just leaking - break on objc_autoreleaseNoPool() to debug Literally printed 3 times. I have no idea what this means but it looks bad. Any advice would be appreciated.

    Read the article

  • Security-Active Application in background-Does it store image of current screen

    - by user1509593
    Is this a probable security flaw. A user in public (lets say Starbucks) tries to log in to iOS application. He enters user id and password [Password is hidden using xxxxxxxx (not exposed)] and a call comes in or he presses home and the application goes to background. a) Does iOS store an image of current screen b) A malicious hacker with intent takes control of the device. Can he read the password ? Do we have to clear out sensitive information while going to background

    Read the article

  • Passing Global Variable value to Facebook - Gets NULL only

    - by Viral
    hi all friends, I am making a game application in that I want to pass my score on wall of face book. I've completed all the things (the log in and message passing part) but when I passes the score via global variable, I am getting only null as a value and not the score that I want. Is there any way to pass data or string to Face book and write on a wall? My code is (void)viewDidLoad { static NSString* kApiKey = @"be60415be308e2b44c0ac1db83fe486b"; static NSString* kApiSecret = @"4f880c7e100321f808c41b1d3c813dfa"; _session = [[FBSession sessionForApplication:kApiKey secret:kApiSecret delegate:self] retain]; score = [NSString stringWithFormat:@"%@",appDelegate.myTextView]; [_session resume]; [super viewDidLoad]; } whre score is NSString and myTextView is NSString in other viewcontrollerfile, And appDelegate is global variable. Any help?? thanks in advance.

    Read the article

  • rendering a new line in a string (\n) with drawRect

    - by Mrwolfy
    I am trying to render a string with a new line (line break \n), using drawRect. The code below renders the my string as a single line, with no line break, even though I am using the \n character. See the second to last line. UIFont *font = [UIFont fontWithName:@"HelveticaNeue-CondensedBlack" size:fontSize]; CGPoint point = CGPointMake(0,0); CGContextRef context = UIGraphicsGetCurrentContext(); CGContextSetRGBFillColor(context, 1.0, 1.0, 1.0, 1.0); CGContextSetRGBStrokeColor(context, 0.0, 0.0, 0.0, 1.0); CGContextSetLineWidth(context, 4.0); CGContextSetTextDrawingMode(context, kCGTextFillStroke); CGContextSaveGState(context); [@"test \n test" drawAtPoint:point withFont:font]; CGContextRestoreGState(context);

    Read the article

  • Alternatives to UIWebView for rich content?

    - by ojreadmore
    In my app, I am displaying 4 "tabs", each are local content through a UIWebView. I create HTML markup from my simple data. This is slow to load and I'm trying to speed it up. I'm using UIWebView to accomplish these: 1. hyperlinks 2. some styling - font colors 3. HTML tables Writing my own class to handle this is okay for (1.) hyperlinks - I can use a touch event to call a method. And (2.) styling - I can use UILables to do basic formatting, no biggie here. BUT what I really love about the UIWebViews is the (3.) HTML tables! I find it troublesome to line up the UILabels in a way that mimics HTML Tables, for instance, one cell's height in a row changes the height of all cells. I'm looking for another perspective or knowledge of an alternative.

    Read the article

  • Can't get rid of this warning?

    - by NextRev
    I'm getting this warning "Format not a string literal and no format arguments? Any ideas? -(BOOL)isFirstPointReached{ NSString *firstPoint = [NSString stringWithFormat:[pointsToFillArray objectAtIndex:0]]; NSString *lastPoint = [NSString stringWithFormat:[pointsToFillArray lastObject]]; if([firstPoint isEqualToString:lastPoint]){ return YES; } else{ return NO; } }

    Read the article

  • change sprite image cocos2d

    - by iPhone Fun
    hi friends, I want to change the sprite image while my application is running. I've taken 5 different sprite objects with different images. but when I use [self removeChild:Name of sprite cleanup:YES]; It is not removing the sprite. So is there any other way to perform such task?? Any help?? Thanks in advance.

    Read the article

  • What's the best approach for modifying PDF interactive form fields on iOS?

    - by gbreen
    I've been doing some head banging on this one and solicit your advice. I am building an app that as part of it's features is to present PDF forms; meaning display them, allow fields to be changed and save the modified PDF file back out. UIWebViews do not support PDF interactive forms. Using the CGPDF apis (and benefit from other questions posted here and elsewhere), I can certainly present the PDF (without the form fields/widgets), scan and find the fields in the document, figure out where on the screen to draw something and make them interactive. What I can't seem to figure out is how to change the CGPDFDictionary objects and write them back out to a file. One could use the CGPDF Apis to create a new PDF document from whole cloth, but how do you use it to modify an existing file? Should I be looking elsewhere such as 3rd party PDF libs like PoDoFo or libHaru? I'd love to hear from anyone who has successfully modified a PDF and written it back out as to your approach. Thanks!

    Read the article

< Previous Page | 62 63 64 65 66 67 68 69 70 71 72 73  | Next Page >