nsstring

using HTTP Post method how to make login page in iphone

匿名 (未验证) 提交于 2019-12-03 03:04:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm have created a Login view. Everytime I login it gives me login Success message will be displayed. even if I enter wrong username and password.I am created login page static.The menctioned link is sample web services link. This is the method I'm using right now:Please give me any idea.Thanks in advance. loginPage.m - (IBAction)login:(id)sender { NSString *post = [NSString stringWithFormat:@"&Username=%@&Password=%@",@"username",@"password"]; NSData *postData = [post dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES];

Right way of inserting data into SQLite db iPhone

匿名 (未验证) 提交于 2019-12-03 03:03:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: How to insert data into table in sqlite iPhone? I am trying following, but its failing: NSString *query=[NSString stringWithFormat:@"insert into %@ (name) values ('%@')", table name,myName ]; sqlite3 *database; sqlite3_stmt *createStmt = nil; if (sqlite3_open([databasePath UTF8String], &database) == SQLITE_OK) { if (createStmt == nil) { if (sqlite3_prepare_v2(database, [query UTF8String], -1, &createStmt, NULL) != SQLITE_OK) { return NO; } sqlite3_exec(database, [query UTF8String], NULL, NULL, NULL); return YES; } return YES; }else { return

iOS 13 DeviceToken获取发生变化

喜夏-厌秋 提交于 2019-12-03 02:57:18
问题描述: iOS 13 通过[deviceToken description]获取到的内容已经变了,这段代码运行在 iOS 13 上已经无法获取到准确的DeviceToken字符串了, NSString *dt = [deviceToken description]; dt = [dt stringByReplacingOccurrencesOfString: @"<" withString: @""]; dt = [dt stringByReplacingOccurrencesOfString: @">" withString: @""]; dt = [dt stringByReplacingOccurrencesOfString: @" " withString: @""]; 解决方案: (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken { if (![deviceToken isKindOfClass:[NSData class]]) return; const unsigned *tokenBytes = [deviceToken bytes]; NSString *hexToken =

How to encrypt the NSString value using DES in iPhone?

匿名 (未验证) 提交于 2019-12-03 02:56:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I used following code to encrypt the NSString value with Key, NSString *token = @"encryptValue"; NSString *key = @"encryptKey"; NSData * keyData = [key dataUsingEncoding: NSUTF8StringEncoding]; NSData * plainData = [token dataUsingEncoding: NSUTF8StringEncoding]; NSMutableData * encData = [NSMutableData dataWithLength: plainData.length + 256]; size_t bytesWritten = 0; CCCryptorStatus ccStatus = CCCrypt (kCCEncrypt, kCCAlgorithmDES, kCCOptionPKCS7Padding, [keyData bytes], kCCKeySizeDES, NULL, [plainData bytes], [plainData length], encData

Showing App&#039;s Build Date

匿名 (未验证) 提交于 2019-12-03 02:56:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am able to display the build date for my app in the simulator, but whenever I archive the app, and upload it to TestFlight, and then install it on a device, the build date doesn't show. Here is what I'm doing to display the build date. First, I added CFBuildDate as a string to myproject-info.plist Next, I added the following script to Edit Scheme -> Build -> Pre-Actions -> Run Script Action : infoplist="$BUILT_PRODUCTS_DIR/$INFOPLIST_PATH" builddate=`date` if [[ -n "$builddate" ]]; then /usr/libexec/PlistBuddy -c "Add :CFBuildDate

UITableViewCell textLabel, does not update until a scroll, or touch happens, while using GCD

匿名 (未验证) 提交于 2019-12-03 02:56:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Can someone help me figure this out please? My UITableViewCell textLabel , does not update until I scroll , or touch it. The ViewController loads, it shows the right amount of cells . But the content is blank. I have to touch it or scroll to make my textLabel appear. Am I doing something wrong here? - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell ==

Xml to dictionary parsing using XML reader [closed]

匿名 (未验证) 提交于 2019-12-03 02:54:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I want to convert data in to dictionary ,any suggestions.. 回答1: if you are newbie and don't know how to parse xml to dictionary... try with the below methods... in .h file add this methods #import <Foundation/Foundation.h> @interface XMLReader : NSObject { NSMutableArray * dictionaryStack ; NSMutableString * textInProgress ; NSError ** errorPointer ; } + ( NSDictionary *) dictionaryForXMLData :( NSData *) data error :( NSError **) errorPointer ; + ( NSDictionary *) dictionaryForXMLString :( NSString *) string error :( NSError **)

How do I use the NSString draw functionality to create a UIImage from text

匿名 (未验证) 提交于 2019-12-03 02:54:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I would like to draw the content of a NSString variable in a UIImage , but I have absolutely no idea how to do this. I need to write a method that would receive a NSString as parameter and return a UIImage with the text drawn into it. 回答1: You can try this: (updated for iOS 4) -(UIImage *)imageFromText:(NSString *)text { // set the font type and size UIFont *font = [UIFont systemFontOfSize:20.0]; CGSize size = [text sizeWithFont:font]; // check if UIGraphicsBeginImageContextWithOptions is available (iOS is 4.0+) if

how to remove error “[NSString stringWithUTF8String:]: NULL cString&#039; ”?

匿名 (未验证) 提交于 2019-12-03 02:51:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am making an sqlite3 test3.sql database, making table as CREATE TABLE rest (name VARCHAR(100), price VARCHAR(100)); table is successfully created but now when I am using a method for inserting and retrieving data, then getting error,,, The error is on line NSString *str = [NSString stringWithUTF8String: (char *)sqlite3_column_text(compiledStatement, 1)]; the error is +[NSString stringWithUTF8String:]: NULL cString' What is this error, how can I remove it? 回答1: Instead of just having ... = [NSString stringWithUTF8String: (char *)sqlite3

Uploading image to server via node.js from an iOS app

匿名 (未验证) 提交于 2019-12-03 02:50:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I am developing an iOS app and I am using node.js for server side scripting. I am facing problem in uploading image to server from iOS app. It is working fine if I am uploading image from webpage form. But if uploading from app side it is not working. //test file h3 Pic Upload form ( action = '/pic_upload' , method = 'post' , enctype = 'multipart/form-data' ) | user_pic : input ( type = 'file' , name = 'user_pic' ) input ( type = 'submit' ) //app.js var userlogin = require ( './routes/userlogin' ); app . post ( '/pic_upload' ,