我得到了NSString来自UIWebView包含iPhone的表情符号,但不包括表情符倒车文本.我需要NSString再次显示反向,UIWebView但无法使用表情符号获取反向字符串.我没有在字符串中识别表情符号字符.我有iOS 6.0的xcode 4.5.这是我的代码:
- (NSString *) createReverseStringFromString:(NSString *)inputString {
if (inputString.length <= 0)
return inputString;
NSMutableString *mutableReverseString = [[NSMutableString alloc]
initWithCapacity:inputString.length];
Thfor (NSInteger i = inputString.length -1; i >= 0; i--) {
NSString *characterString = [inputString substringWithRange:NSMakeRange(i, 1)];
[mutableReverseString appendString:characterString];
NSLog(@"mutableReverseString..%@",mutableReverseString);
}
NSString *outputString = [mutableReverseString copy];
[mutableReverseString release];
return [outputString autorelease];
}
Run Code Online (Sandbox Code Playgroud) 我添加了facebook sdk来访问用户帐户.但是当用户已经通过iOS 6 facebook登录facebook时,然后在我的应用程序的第一页上,它必须显示应用程序要求配置文件权限的警报.为此,我在app delegate中添加了以下代码
[FBSession openActiveSessionWithAllowLoginUI:true];
NSArray *permissions = [NSArray arrayWithObjects:
@"friends_about_me",nil];
[FBSession openActiveSessionWithReadPermissions:permissions allowLoginUI:true
completionHandler:^(FBSession *session, FBSessionState status, NSError *error) {
if (error) {
NSLog(@"Failure");
}
}];
return YES;
Run Code Online (Sandbox Code Playgroud)
}
- (BOOL)application:(UIApplication*)application openURL:(NSURL )url sourceApplication:(NSString)sourceApplication annotation:(id)annotation {return [FBSession.activeSession handleOpenURL:url]; }
我正在收到警报. 
但是,当我点击确定按钮时,它会给我以下错误
FBSDKLog:系统授权失败:'Facebook服务器无法满足此访问请求:remote_app_id与存储的ID不匹配'.这可能是由于开发人员在face.facebook.com/apps上捆绑标识符与服务器上的应用配置不匹配造成的.
但在我的fb开发者帐户中,一切都很好.请帮我解决这个问题.
谢谢!
我是使用Cocoa进行Mac应用程序开发的新手.我对窗口/视图大小应该是什么感到困惑.就像在iOS应用程序中一样,我们有适合小型iPod和最新iPod的尺寸.但是如何在Cocoa应用程序中设置大小.
另外,我想将部署目标设置为OS X 10.6,它不支持AutoLayout.
那么什么是调整适合每个桌面的窗口的好方法呢?
我遇到了麻烦.我有一个城市列表,我想显示城市UITableView,我已禁用UITableView的滚动,因为我不想显示滚动.
当我动态更改为UITableView的高度时,它不会更改,UITableView不会显示所有城市.代码下方.请看看.
import UIKit
class FlightDetailsOneWayViewController: UIViewController {
var flightDetailArr:[FlightDetailsOneWay] = [FlightDetailsOneWay]()
@IBOutlet var tableView: UITableView!
@IBOutlet var scrollview: UIScrollView!
override func viewDidLoad() {
super.viewDidLoad()
flightDetailArr.append(FlightDetailsOneWay(depCity: "London"))
flightDetailArr.append(FlightDetailsOneWay(depCity: "China"))
flightDetailArr.append(FlightDetailsOneWay(depCity: "Singapore"))
flightDetailArr.append(FlightDetailsOneWay(depCity: "Dubai"))
self.tableView.scrollEnabled = false
var cellHeight = CGFloat(self.tableView.rowHeight)
var totalCity = CGFloat(flightDetailArr.count)
var totalHeight = cellHeight * totalCity
self.tableView.frame.size.height = CGFloat(totalHeight)
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
func tableView(tableView: UITableView!, numberOfRowsInSection section: Int) -> Int { …Run Code Online (Sandbox Code Playgroud) 我正在制作一个应用程序,我想实现Siri /语音识别的概念.我试过这个,但没有得到输出正是它没有正确识别这个词.任何人都知道如何将语音转换为文本?如何访问Siri功能.如果有人知道这个实现,请告诉我.
谢谢大家.
我正在使用Contentful.com我的iOS应用程序作为内容后端.geo-point在我的Swift项目中,我不能让他们回到我身边.
Contentful文档说他们的API回报是" NSData与" CLLocationCoordinate2D struct.
我NSValue在我的项目中接近这个,但我无法让它正常工作.这是我的代码:
var locationCoord:CLLocationCoordinate2D = CLLocationCoordinate2D(latitude: 0,longitude: 0)
var locationData:NSData = entry.fields["location"] as NSData
var locationValue:NSValue = NSValue(bytes: locationData.bytes, objCType: "CLLocationCoordinate2D")
locationCoord = locationValue.MKCoordinateValue
Run Code Online (Sandbox Code Playgroud)
然而,locationCoord.latitude和locationCoord.longitude return错误值(他们总是被一个0.0).
有人能告诉我这里我做错了什么,以及如何正常工作?谢谢.
我正在开发一个应用程序,我必须检测是否有任何已经在设备上运行的应用程序.我想要所有正在运行的应用程序列表.我就这个话题进行了研发,但我一无所获.有没有办法做到这一点?