Search Results

Search found 11296 results on 452 pages for 'facebook sdk 3 0'.

Page 99/452 | < Previous Page | 95 96 97 98 99 100 101 102 103 104 105 106  | Next Page >

  • Facebook Connect Publish to Stream: how do I tag a user?

    - by Sean Cannon
    I have an application that allows martial arts trickers to 'battle' each other by initiating challenges and submitting videos and whatnot. When user A challenges user B, the application posts to the user's wall (the one who initiated the challenge). My question is how do I tag user B in the wall post? It essentially says "challenged John Do to a battle". I'd like "John Do" to link to his profile just like when you manually post something on your wall and use the @ symbol. I hope this makes sense. I've tried standard html for a link, and I've tried FBML. Neither are parsed and only render as plain text on the wall post. Thanks for any help!

    Read the article

  • Iphone sdk, How to post data to web server? anybody has example ?

    - by user352385
    Hi, guys, I want to post data to web server, like username and password, on the web server, I used PHP to echo yes or no, I attached all the code. Can anybody help me out, what is wrong with the code. Since it always says incorrect password or username. I tried to test the php code with username and password inside, it is working. So please help me. Thank you. Header file @interface kiksyloginViewController : UIViewController { IBOutlet UITextField *usernameField; IBOutlet UITextField *passwordField; IBOutlet UIButton *loginButton; } @property (nonatomic, retain) UITextField *usernameField; @property (nonatomic, retain) UITextField *passwordField; @property (nonatomic, retain) UIButton *loginButton; (IBAction) login: (id) sender; @end Implementation file #import "kiksyloginViewController.h" @implementation kiksyloginViewController @synthesize usernameField; @synthesize passwordField; @synthesize loginButton; (IBAction) login: (id) sender { NSString *post =[NSString stringWithFormat:@"username=%@&password=%@",usernameField.text, passwordField.text]; NSString *hostStr = @"http://localhost/userlogin.php"; hostStr = [hostStr stringByAppendingString:post]; NSData *dataURL = [NSData dataWithContentsOfURL: [ NSURL URLWithString: hostStr ]]; NSString *serverOutput = [[NSString alloc] initWithData:dataURL encoding: NSASCIIStringEncoding]; if([serverOutput isEqualToString:@"Yes"]){ UIAlertView *alertsuccess = [[UIAlertView alloc] initWithTitle:@"Congrats" message:@"You are authorized " delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil]; [alertsuccess show]; [alertsuccess release]; } else { UIAlertView *alertsuccess = [[UIAlertView alloc] initWithTitle:@"Error" message:@"Username or Password Incorrect" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil]; [alertsuccess show]; [alertsuccess release]; } } (void)didReceiveMemoryWarning { // Releases the view if it doesn’t have a superview. [super didReceiveMemoryWarning]; // Release any cached data, images, etc that aren’t in use. } (void)viewDidUnload { // Release any retained subviews of the main view. // e.g. self.myOutlet = nil; } (void)dealloc { [super dealloc]; } @end PHP file <?php //$Container = new Container ; $u = $_GET['username']; $pw =$_GET['password']; $check = "select username, password from user where username='$u' and password='$pw'"; function myDbconn() { mysql_connect("localhost", "root","") or die(); mysql_select_db("test") or die (mysql_error()); } myDbconn(); $login = mysql_query($check) or die (mysql_error()); //$run = DB()-select($check); if (mysql_num_rows($login)==1){ //$row = DB()-fetch($run); //$row = DB()-fetch($login); $row = mysql_fetch_assoc($login); echo 'yes'; exit; } else { echo 'No'; exit; } ?

    Read the article

  • iPhone SDK: How to detect a row-hit while in the editing mode?

    - by Carol
    I've looked everywhere and I can't find it. I have a UITableView that contain rows of "checkmark" cells. The user clicks on a row to check/uncheck it. (It works!!!!) But I also want to allow the user to EDIT the data on that row. ... so I have an "EDIT" button at the top. The user hits it and is allowed to DELETE any rows. (That works too!!!!) But how do I also detect a "tap" on that row. Where is there some kind of a didSelectRowAtIndexPathWhileInEditMode ???? (Is that really the best way to do this: Allow "selections", and "deletions", and "editing" of each row?)

    Read the article

  • iphone SDK: How to check user set up a valid IP , Netmask , Router ???

    - by WebberLai
    It is simple to understand after this pic. I add fewtextfields in tableview I already set the keyboard style is number pad. Now the problems is 1.Do I need to create 12 textfields ???ex. UITextField *ip1,ip2,ip3,ip4....or just set different tag for textfield ? 2.How to check user enter wrong char not 3 valid numbers (even the keyboard is set number pad,but it might can paste words...) 3.How to check user did follow this setting rules ??? <1If IP1 is 0~223 , IP2 need to be set 0~255,IP3,IP4 both are 0~255 <2If IP1 is 172 ,IP2 is set 16~31.IP3,IP4 both are 0~255; If IP1 is 192 ,IP2 must be 168.IP3 IP4 are 0~255 <3Netmask set default 255.255.255.0 <4Router 0~223 ,0~255 ,0~255 ,0~255 This IP setting rules is my friends tech me this ...I not sure the rules is right or not?

    Read the article

  • Iphone SDK quesiton: How to make a Drawing method in a View class work using CGContextRef?

    - by SimpleCode
    I have these 2 methods in the View class. the drawRect method always gets called when the view is initalized. But i can't get the drawLine method to work. It doesn't do anything when it gets called. Am i supposed to deal with cgimagecontext or something like that? please help!! (void)drawRect:(CGRect)rect { // Drawing code // Drawing code CGContextRef contextRef = UIGraphicsGetCurrentContext(); //CGContextSetRGBFillColor(contextRef, 0, 0, 255, 1); CGContextSetRGBStrokeColor(contextRef, 0, 0, 0, 1); CGContextSetLineWidth(contextRef, 5.0); CGContextBeginPath(contextRef); CGContextMoveToPoint(contextRef, 0, 0); CGContextAddLineToPoint(contextRef, 320, 480); CGContextStrokePath(contextRef); } -(void)drawLine:(CGPoint)from to:(CGPoint) to { // Drawing code CGContextRef contextRef = UIGraphicsGetCurrentContext(); //CGContextSetRGBFillColor(contextRef, 0, 0, 255, 1); CGContextSetRGBStrokeColor(contextRef, 0, 128, 0, 1); CGContextSetLineWidth(contextRef, 5.0); CGContextBeginPath(contextRef); CGContextMoveToPoint(contextRef, 0, 0); CGContextAddLineToPoint(contextRef, 320, 50); CGContextStrokePath(contextRef); }

    Read the article

  • IPhone sdk stop the accelerometer from working when something happens.

    - by Harry
    Hi, I am using the accelerometer to move a few UIImageViews around the screen, at the moment the accelerometer only works when a NSTimer is at 0, this is fine. I would also like to make the accelerometer stop again when a different function happens. here is my code at the moment: -(BOOL) accelerometerWorks { return time == 0; } -(void) accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceleration *)acceleration{ if(![self accelerometerWorks]) return; valueX = acceleration.x*25.5; int newX = (int)(ball.center.x +valueX); if (newX 320-BALL_RADIUS) newX = 320-BALL_RADIUS; if (newX < 0+BALL_RADIUS) newX = 0+BALL_RADIUS; int XA = (int)(balloonbit1.center.x +valueX); if (XA 320-BALL_RADIUS) XA = 320-BALL_RADIUS; if (XA < 0+BALL_RADIUS) XA = 0+BALL_RADIUS; int XB = (int)(balloonbit2.center.x +valueX); if (XB 320-BALL_RADIUS) XB = 320-BALL_RADIUS; if (XB < 0+BALL_RADIUS) XB = 0+BALL_RADIUS; int XI = (int)(balloonbit3.center.x +valueX); if (XI 320-BALL_RADIUS) XI = 320-BALL_RADIUS; if (XI < 0+BALL_RADIUS) XI = 0+BALL_RADIUS; int XJ = (int)(balloonbit4.center.x +valueX); if (XJ 320-BALL_RADIUS) XJ = 320-BALL_RADIUS; if (XJ < 0+BALL_RADIUS) XJ = 0+BALL_RADIUS; int XE = (int)(balloonbit5.center.x +valueX); if (XE 320-BALL_RADIUS) XE = 320-BALL_RADIUS; if (XE < 0+BALL_RADIUS) XE = 0+BALL_RADIUS; int XF = (int)(balloonbit6.center.x +valueX); if (XF 320-BALL_RADIUS) XF = 320-BALL_RADIUS; if (XF < 0+BALL_RADIUS) XF = 0+BALL_RADIUS; int XH = (int)(balloonbit8.center.x +valueX); if (XH 320-BALL_RADIUS) XH = 320-BALL_RADIUS; if (XH < 0+BALL_RADIUS) XH = 0+BALL_RADIUS; ball.center = CGPointMake (newX, 429); balloonbit1.center = CGPointMake (XA, 429); balloonbit2.center = CGPointMake (XB, 426); balloonbit3.center = CGPointMake (XI, 410); balloonbit4.center = CGPointMake (XJ, 415); balloonbit5.center = CGPointMake (XE, 409); balloonbit6.center = CGPointMake (XF, 427); balloonbit8.center = CGPointMake (XH, 417); } This all works fine, i would now like to stop the accelerometer from working, using the same accelerometerWorks method or a new method, accelerometerWontWork. This is the code that when it is called i would like the accelerometer to stop. (it is very long so i wont put all of it there, but its all the same throughout): -(void) checkCollision{ if (CGRectIntersectsRect(pinend.frame, balloonbit1.frame)){ if (balloonbit1.frame.origin.y pinend.frame.origin.y){ [maintimer invalidate]; levelfailed.center = CGPointMake (160, 235); } } if (CGRectIntersectsRect(pinend.frame, balloonbit2.frame)){ if (balloonbit2.frame.origin.y pinend.frame.origin.y){ [maintimer invalidate]; levelfailed.center = CGPointMake (160, 235); } } if (CGRectIntersectsRect(pinend.frame, balloonbit3.frame)){ if (balloonbit3.frame.origin.y pinend.frame.origin.y){ [maintimer invalidate]; levelfailed.center = CGPointMake (160, 235); } } } I understand that i may have to turn this into a BOOL. Thats fine. If i haven't explained it well please say and i will re write it. Thanks! Harry.

    Read the article

  • How to check for local Wi-Fi (not just cellular connection) using iPhone SDK?

    - by Michael
    I'm currently using the following to check whether Wi-Fi is available for my application: #import <SystemConfiguration/SystemConfiguration.h> static inline BOOL addressReachable(const struct sockaddr_in *hostAddress); BOOL localWiFiAvailable() { struct sockaddr_in localWifiAddress; bzero(&localWifiAddress, sizeof(localWifiAddress)); localWifiAddress.sin_len = sizeof(localWifiAddress); localWifiAddress.sin_family = AF_INET; // IN_LINKLOCALNETNUM is defined in <netinet/in.h> as 169.254.0.0 localWifiAddress.sin_addr.s_addr = htonl(IN_LINKLOCALNETNUM); return addressReachable(&localWifiAddress); } static inline BOOL addressReachable(const struct sockaddr_in *hostAddress) { const SCNetworkReachabilityRef target = SCNetworkReachabilityCreateWithAddress(kCFAllocatorDefault, (const struct sockaddr *)hostAddress); if (target != NULL) { SCNetworkReachabilityFlags flags = 0; const BOOL reachable = SCNetworkReachabilityGetFlags(target, &flags); CFRelease(target); return reachable && (flags & kSCNetworkFlagsReachable); } return NO; } This, however, does not return NO as it should when the iPhone is connected only to a cellular network but not a Wi-Fi network. Does anyone know how to fix this? Edit So this is what I ended up using: #import <arpa/inet.h> // For AF_INET, etc. #import <ifaddrs.h> // For getifaddrs() #import <net/if.h> // For IFF_LOOPBACK BOOL localWiFiAvailable() { struct ifaddrs *addresses; struct ifaddrs *cursor; BOOL wiFiAvailable = NO; if (getifaddrs(&addresses) != 0) return NO; cursor = addresses; while (cursor != NULL) { if (cursor -> ifa_addr -> sa_family == AF_INET && !(cursor -> ifa_flags & IFF_LOOPBACK)) // Ignore the loopback address { // Check for WiFi adapter if (strcmp(cursor -> ifa_name, "en0") == 0) { wiFiAvailable = YES; break; } } cursor = cursor -> ifa_next; } freeifaddrs(addresses); return wiFiAvailable; } Thanks "unforgiven" (and Matt Brown apparently).

    Read the article

  • iPhone SDK: Know when tab on Tab Bar is clicked?

    - by Nic Hubbard
    I have a tab bar which displays different views when clicked. When you click a tab for the first time, it calls the viewDidLoad method. But, it only calls that the first time. Is there a method that is called when a user clicks back to that tab, since the viewDidLoad won't be called that second time? (I need to do this to update a UITableView when the user clicks back to a tab)

    Read the article

  • How does my php function for converting a date to facebook timestamp look? New to PHP.

    - by First2Drown
    any suggestions to make it better? function convertToFBTimestamp($date){ $this_date = date('Y-m-d-H-i-s', strtotime($date)); $cur_date = date('Y-m-d-H-i-s'); list ($this_year, $this_month, $this_day, $this_hour, $this_min, $this_sec) = explode('-',$this_date); list ($cur_year, $cur_month, $cur_day, $cur_hour, $cur_min, $cur_sec) = explode('-',$cur_date); $this_unix_time = mktime($this_hour, $this_min, $this_sec, $this_month, $this_day, $this_year); $cur_unix_time = mktime($cur_hour, $cur_min, $cur_sec, $cur_month, $cur_day, $cur_year); $cur_unix_date = mktime(0, 0, 0, $cur_month, $cur_day, $cur_year); $dif_in_sec = $cur_unix_time - $this_unix_time; $dif_in_min = (int)($dif_in_sec / 60); $dif_in_hours = (int)($dif_in_min / 60); if(date('Y-m-d',strtotime($date))== date('Y-m-d')) { if($dif_in_sec < 60) { return $dif_in_sec." seconds ago"; } elseif($dif_in_sec < 120) { return "about a minute ago"; } elseif($dif_in_min < 60) { return $dif_in_min." minutes ago"; } else { if($dif_in_hours == 1) { return $dif_in_hours." hour ago"; } else { return $dif_in_hours." hours ago"; } } } elseif($cur_unix_date - $this_unix_time < 86400 ) { return strftime("Yesterday at %l:%M%P",$this_unix_time); } elseif($cur_unix_date - $this_unix_time < 259200) { return strftime("%A at %l:%M%P",$this_unix_time); } else { if($this_year == $cur_year) { return strftime("%B, %e at %l:%M%P",$this_unix_time); } else { return strftime("%B, %e %Y at %l:%M%P",$this_unix_time); } } }

    Read the article

  • iPhone SDK: Can a UIButton with custom images display the title?

    - by Harkonian
    If I create a custom UIButton with images for UIControlState normal and UIControlStateSelected, am I still supposed to be able to display the title for the button? Currently I can't. This is how I create my button: UIImage *moveButtonImage = [UIImage imageWithContentsOfFile: [[NSBundle mainBundle] pathForResource:@"button_move_inactive" ofType:@"png"] ]; UIImage *moveButtonSelectedImage = [UIImage imageWithContentsOfFile: [[NSBundle mainBundle] pathForResource:@"button_move_pressed" ofType:@"png"] ]; self.moveButton = [UIButton buttonWithType:UIButtonTypeCustom]; [self.moveButton setImage : moveButtonImage forState : UIControlStateNormal]; [self.moveButton setImage : moveButtonSelectedImage forState : UIControlStateSelected]; [self.moveButton setTitle:@"Test" forState:UIControlStateNormal]; The button title never displays in this case and I'm forced to create my own label to display on the button, which seems like a hacky way of doing things. Maybe I'm doing something wrong here?

    Read the article

  • Image jQuery scroller in a container. (like facebook cropper) can't get values of position.

    - by Stefan
    Hey all. Having a reallllll mind pain. I have a php image uploader which is all good and sotring the file and the jquery ajax is returning the image in an ammended html div with a div set up like this: #crop-holder { width:80px; height:80px; margin:10px 10px 20px 10px; border:1px #c0c0c0 solid; overflow:hidden; cursor:move; } The image is viewing fine and I am using the jquery scrollview plugin: http://code.google.com/p/jquery-scrollview/ I have tried adding a few lines to the plugin to store variables of scrollTop and Left and then replacing two hidden input values with x and y in my page. And then on the returned ajax html in the div I am trying to on a button click (for example) retrieve the values of the two hidden inputs.... Heres what i added to the plugin (i'm no js expert!): .mouseout(function(){ var _m = this.m; var lasty = _m.scrollTop(); getElementById("ycord").value = lasty; var lastx = _m.scrollLeft(); getElementById("xcord").value = lastx; self.stopgrab(); }) Still no luck!! How can I get the scrollTop and scrollLeft and successfully prepare them for sending onto another php script!? Thanks:) stefpretty

    Read the article

  • iphone sdk: autorotate jumps back up the page, showing information that has already been read...

    - by jonathan
    Hi, I am using - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation{ return YES; } to allow rotation, which works fine - except that the landscape view jumps backwards up the page that is being displayed. I can't figure out what I should be looking at to fix it. I just want the page to rotate where it is. Any pointers would be great. Am a noob, as is probably clear. Thanks Jonathan

    Read the article

  • Inserting a string array as a row into an Excel document using the Open XML SDK 2.0

    - by Sam
    The code runs, but corrupts my excel document. Any help would be mucho appreciated! I used this as a reference. public void AddRow(string fileName, string[] values) { using (SpreadsheetDocument doc = SpreadsheetDocument.Open(fileName, true)) { SharedStringTablePart sharedStringPart = GetSharedStringPart(doc); WorksheetPart worksheetPart = doc.WorkbookPart.WorksheetParts.First(); uint rowIdx = AppendRow(worksheetPart); for (int i = 0; i < values.Length; ++i) { int stringIdx = InsertSharedString(values[i], sharedStringPart); Cell cell = InsertCell(i, rowIdx, worksheetPart); cell.CellValue = new CellValue(stringIdx.ToString()); cell.DataType = new EnumValue<CellValues>( CellValues.SharedString); worksheetPart.Worksheet.Save(); } } } private SharedStringTablePart GetSharedStringPart( SpreadsheetDocument doc) { if (doc.WorkbookPart. GetPartsCountOfType<SharedStringTablePart>() > 0) return doc.WorkbookPart. GetPartsOfType<SharedStringTablePart>().First(); else return doc.WorkbookPart. AddNewPart<SharedStringTablePart>(); } private uint AppendRow(WorksheetPart worksheetPart) { SheetData sheetData = worksheetPart.Worksheet. GetFirstChild<SheetData>(); uint rowIndex = (uint)sheetData.Elements<Row>().Count(); Row row = new Row() { RowIndex = rowIndex }; sheetData.Append(row); return rowIndex; } private int InsertSharedString(string s, SharedStringTablePart sharedStringPart) { if (sharedStringPart.SharedStringTable == null) sharedStringPart.SharedStringTable = new SharedStringTable(); int i = 0; foreach (SharedStringItem item in sharedStringPart.SharedStringTable. Elements<SharedStringItem>()) { if (item.InnerText == s) return i; ++i; } sharedStringPart.SharedStringTable.AppendChild( new Text(s)); sharedStringPart.SharedStringTable.Save(); return i; } private Cell InsertCell(int i, uint rowIdx, WorksheetPart worksheetPart) { SheetData sheetData = worksheetPart.Worksheet. GetFirstChild<SheetData>(); string cellReference = AlphabetMap.Instance[i] + rowIdx; Cell cell = new Cell() { CellReference = cellReference }; Row row = sheetData.Elements<Row>().ElementAt((int)rowIdx); row.InsertAt(cell, i); worksheetPart.Worksheet.Save(); return cell; }

    Read the article

  • Converting image to Black & White image on iPhone SDK issues.

    - by KfirS
    Hello, I've used a familiar code to convert image to Black & White which I've founded on several forums. The code is: CGColorSpaceRef colorSapce = CGColorSpaceCreateDeviceGray(); CGContextRef context = CGBitmapContextCreate(nil, originalImage.size.width, originalImage.size.height, 8, originalImage.size.width, colorSapce, kCGImageAlphaNone); CGContextSetInterpolationQuality(context, kCGInterpolationHigh); CGContextSetShouldAntialias(context, NO); CGContextDrawImage(context, CGRectMake(0, 0, originalImage.size.width, originalImage.size.height), [originalImage CGImage]); CGImageRef bwImage = CGBitmapContextCreateImage(context); CGContextRelease(context); CGColorSpaceRelease(colorSapce); UIImage *resultImage = [UIImage imageWithCGImage:bwImage]; // This is result B/W image. CGImageRelease(bwImage); return resultImage; When I'm using this code with on Horizontal image it's work fine, but when I'm trying a to use this code on Vertical image, the result is disproportionate image and rotate 90 degree left. Can anyone know what could be the problem? Thanks, Kfir.

    Read the article

  • iPhone SDK: How to store the time each word was typed?

    - by Harkonian
    My problem is twofold: 1) I'm trying to determine an eloquent way to allow the user to type into a UITextView and store the time each word was typed into an array. The time will be a float which starts at 0 when the user begins to type. 2) Conversely, I'd like the user to be able to tap on a word in the UITextView and display the time that word was typed (displaying in an NSLog() is fine). Considerations that may throw a wrench into a possible approach -- what if the user goes back to the top of the text and starts typing or to the middle of the text? Even a suggested approach without code would be appreciated, because right now I'm drawing a blank.

    Read the article

  • How to make RegexKitLite w/ iPhone SDK produce a list of all matches +/- and also return surrounding

    - by Matt
    I'd like to create a regular expression that will match and return based on the following criteria: 1) I have N search terms entered by a user 2) I have a body of text. 3) I want to return a list of all the occurrences of all the search terms entered by the user plus surrounding context. I think (\w+\W+){,4}(", ")(\W+\w+){,4} might work. 4) I don't know how to use RegexKitLite at all. Do I invoke a RegexKitLite class? or does it interface into NSString somehow?

    Read the article

< Previous Page | 95 96 97 98 99 100 101 102 103 104 105 106  | Next Page >