.h和xmpp的.m文件,我正在尝试聊天应用程序.
但是,当我构建项目时,我得到以下错误,我试图解决过去24小时的问题,但是没有成功获得解决方案,我甚至用谷歌搜索但没有得到解决方案.以下是我得到的错误,
Undefined symbols for architecture i386:
"_dns_free_resource_record", referenced from:
-[XMPPSRVResolver processRecord:length:] in XMPPSRVResolver.o
"_dns_parse_resource_record", referenced from:
-[XMPPSRVResolver processRecord:length:] in XMPPSRVResolver.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Run Code Online (Sandbox Code Playgroud) 如何在目标C中将字符串转换为数组.即,我有一个字符串,
NSString *str = @"Hi,How r u";
Run Code Online (Sandbox Code Playgroud)
这应该转换为数组*NSMutableArray arr,其中
arr [0] ="Hi"
arr [1] =","
arr [2] ="How"
arr [3] ="r"
arr [4] ="u"
任何人都可以帮助解决这个问题.
我使用以下代码获取当前位置,我已添加了corelocation框架
- (void)viewDidLoad {
[super viewDidLoad];
locationManager = [[CLLocationManager alloc] init];
locationManager.delegate = self;
locationManager.distanceFilter = kCLDistanceFilterNone; // whenever we move
locationManager.desiredAccuracy = kCLLocationAccuracyHundredMeters; // 100 m
[locationManager startUpdatingLocation];
}
- (void)locationManager:(CLLocationManager *)manager
didUpdateToLocation:(CLLocation *)newLocation
fromLocation:(CLLocation *)oldLocation
{
int degrees = newLocation.coordinate.latitude;
double decimal = fabs(newLocation.coordinate.latitude - degrees);
int minutes = decimal * 60;
double seconds = decimal * 3600 - minutes * 60;
NSString *lat = [NSString stringWithFormat:@"%d° %d' %1.4f\"",
degrees, minutes, seconds];
NSLog(@" Current Latitude : %@",lat);
//latLabel.text …Run Code Online (Sandbox Code Playgroud) 问题是,当图像大小超过 60 kb 时,它不会将图像发布到 Web 服务,但如果图像大小小于 60 kb,则将其发布到 Web 服务。
如何减小目标 c 中图像的大小。以下是我正在使用的代码,
-(IBAction)sendEmail:(id)sender
{
AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
NSLog(@"TABLEDIC%@",appDelegate.tableDic);
//Parsing
recordResults = FALSE;
NSString *soapMessage = [NSString stringWithFormat:@"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
"<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">\n"
"<soap:Body>\n"
"<CreateTextMail xmlns=\"http://tempuri.org/\">\n"
"<listid>%@</listid>\n"
"<fromid>%@</fromid>\n"
"<subject>%@</subject>\n"
"<replyto>%@</replyto>\n"
"<loginid>%@</loginid>\n"
"<fromname>%@</fromname>\n"
"<forward>%@</forward>\n"
"<subscribe>%@</subscribe>\n"
"<mailpriority>%@</mailpriority>\n"
"<recievermailtext>%@</recievermailtext>\n"
"<mailbody>%@</mailbody>\n"
"<emailname>%@</emailname>\n"
"<signature>%@</signature>\n"
"<listname>%@</listname>\n"
"<emailtype>%@</emailtype>\n"
"<imagecontent>%@</imagecontent>\n"
"<imagename>%@</imagename>"
"</CreateTextMail>\n"
"</soap:Body>\n"
"</soap:Envelope>\n",[appDelegate.tableDic valueForKey:@"tableID"],[appDelegate.tableDic valueForKey:@"fromname"],[appDelegate.tableDic valueForKey:@"subject"],[appDelegate.tableDic valueForKey:@"replyto"],[appDelegate.tableDic valueForKey:@"loginid"],[appDelegate.tableDic valueForKey:@"fromname"],forward.text,subscribe.text,[appDelegate.tableDic valueForKey:@"mailpriority"],receivermailtext.text,body.text,[appDelegate.tableDic valueForKey:@"emailName"],[appDelegate.tableDic valueForKey:@"signature"],[appDelegate.tableDic valueForKey:@"tableName"],emailType,strEncoded,imageName.text
];
NSLog(@"SOPA%@",soapMessage);
NSURL *url = [NSURL URLWithString:@"http://www.xxx.net/xxx/xxx.asmx"];
NSMutableURLRequest *theRequest …Run Code Online (Sandbox Code Playgroud) iphone soap web-services objective-c uiimagepickercontroller
如何用目标C中的数组中的UnderScore(_)替换Space.以下是我用来从文件中读取数组数据的代码,
NSString *g = [[NSString alloc]initWithCString:data];
NSMutableString *tempGetAll = [[NSMutableString alloc]init];
if(k>0){
NSArray *lines = [g componentsSeparatedByCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@""]];
for (NSString* line in lines)
{
//[arrGetAll addObject: line];
NSLog(@"%@",line) ;
//NSLog(@"---------");
}
}
k++;
Run Code Online (Sandbox Code Playgroud)
以下是我得到的输出,
嗨如何ru 20.000
但我需要以下列方式输出,
hi_how_r_u:20.000
所以如何用Underscore替换空间.
objective-c ×4
iphone ×3
arrays ×2
ios7 ×1
ipad ×1
soap ×1
string ×1
web-services ×1
xcode5 ×1