是否可以为UILabel的文本属性更改时设置通知?当我找不到UILabel时,我尝试了用于UITextFields的那个,但它没有用.
[[NSNotificationCenter defaultCenter]
addObserver:self
selector:@selector(posttosocial)
name:UITextFieldTextDidChangeNotification
object:nowplaying];
Run Code Online (Sandbox Code Playgroud) 我正在尝试将Apple Watch App提交给Apple.验证时,它总是会因各种info.plist问题而失败.其中一个说:
The key ‘CFBundleIcons~ipad’ in bundle iPrayed.app/PlugIns/iPrayed WatchKit Extension.appex/iPrayed WatchKit App.app is invalid.
此外,我还收到了有关无效图标名称的各种错误.我搜索过这些,但我没有看到它们.此外,Watch App中的CFBundleIcons键永远不会显示在我所在的Info.plist中.我究竟做错了什么?下面是三个屏幕截图,其中一个错误,一个显示手表应用程序的目标,以及我在Watch App中的一个Image Assets文件.



我已经尝试为我的Parse应用程序添加可操作通知,iPrayed 4 U.在应用程序中,有人可以通过单击按钮为您"祷告".这样做会运行包含APNS有效负载类别的Cloud Code.在我的AppDelegate中,我有:
if ([application respondsToSelector:@selector(isRegisteredForRemoteNotifications)])
{UIUserNotificationType types = UIUserNotificationTypeBadge |
UIUserNotificationTypeSound | UIUserNotificationTypeAlert;
UIMutableUserNotificationAction *acceptAction =
[[UIMutableUserNotificationAction alloc] init];
acceptAction.identifier = @"THANKS_IDENTIFIER";
acceptAction.title = @"Say Thanks";
// Given seconds, not minutes, to run in the background
acceptAction.activationMode = UIUserNotificationActivationModeBackground;
acceptAction.destructive = NO;
acceptAction.authenticationRequired = NO;
UIMutableUserNotificationCategory *inviteCategory =
[[UIMutableUserNotificationCategory alloc] init];
inviteCategory.identifier = @"TAGGED_CATEGORY";
[inviteCategory setActions:@[acceptAction]
forContext:UIUserNotificationActionContextDefault];
NSSet *categories = [NSSet setWithObjects:inviteCategory, nil];
UIUserNotificationSettings *settings =
[UIUserNotificationSettings settingsForTypes:types categories:categories];
[[UIApplication sharedApplication]
registerUserNotificationSettings:settings];
[application registerForRemoteNotifications];
}
- (void)application:(UIApplication *)application …Run Code Online (Sandbox Code Playgroud) iphone apple-push-notifications ios parse-platform apple-watch
在我的UIViewController我试图查询我的解析服务器,但我不断得到它的返回0,虽然我知道100%这个类确实有对象.有什么想法吗?
PFQuery *query = [PFQuery queryWithClassName:@"General"];
int i;
for (i = 0; i < [follows count]; i++) {
[query whereKey:@"Session" containedIn:follows];
}
query.cachePolicy = kPFCachePolicyCacheThenNetwork;
[query orderByDescending:@"createdAt"];
[query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) {
// it never gets here...
NSLog(@"OBJECTS%@", objects);
if (!error) {
NSLog(@"Successfully retrieved %lu objects.", (unsigned long)objects.count);
for (PFObject *object in objects) {
NSLog(@"%@", object.objectId);
}
// [self gotoMain];
} else {
NSLog(@"Error: %@ %@", error, [error userInfo]);
}
}];
Run Code Online (Sandbox Code Playgroud)
它告诉我在控制台中成功检索0个对象没有错误.
我在用:
if ([FBSDKAccessToken currentAccessToken]) {
[[[FBSDKGraphRequest alloc] initWithGraphPath:@"/v2.3/ID/feed" parameters:nil]
startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) {
if (!error) {
NSLog(@"fetched user:%@", result);
}
}];
}
Run Code Online (Sandbox Code Playgroud)
这给了我一个来自Facebook页面的所有数据的JSON字符串(AND I MEAN ALL).它给了我帖子,喜欢帖子的人的ID,每个评论,每个分享的人.我真的只需要帖子本身,它在JSON结果中列为'message'.有没有办法在API调用中执行此操作,还是必须在之后执行?
此外,有没有办法让它拉出与每个帖子相关的图片?我知道如何将照片发布到页面,但我只是想查看对页面发布的帖子,并让它拉出图片.
我正在研究添加到我的tvOS应用程序,以便查看存储在应用程序中的PDF.但是,如果没有UIWebView,我会对如何做到这一点感到茫然.我在其他地方问了一个问题,并且收到一条链接,指向Apple提供的关于可以使用的API的冗长而无助的文档,甚至在这里它已被引用(CGPDFPage),但没有关于如何实现这个的实际指南.有没有人在tvOS上成功完成此操作,如果是这样,你会帮助我开始这个过程吗?
更新2:
这是映射中的现有代码,但它就像注释使用引脚完全无序.一次引脚为绿色,下次运行时,相同的引脚为红色.断开来自哪里?
-(void) viewWillAppear:(BOOL)animated {
self.annotationArray = [[NSMutableArray alloc] init];
CLLocationCoordinate2D coord = {.latitude = 15.8700320, .longitude = 100.9925410};
MKCoordinateSpan span = {.latitudeDelta = 3, .longitudeDelta = 3};
MKCoordinateRegion region = {coord, span};
[mapViewUI setRegion:region];
PFQuery *query = [PFQuery queryWithClassName:@"Share"];
[query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) {
if (!error) {
self.mapViewData = objects;
for (int i=0;i<[objects count];i++)
{
// Question * q = [[Question alloc]init];
PFObject * obj = [self.mapViewData objectAtIndex:i];
NSLog(@"%@", obj);
self.theObject = obj;
NSString *string = obj[@"WhereAt"];
NSArray …Run Code Online (Sandbox Code Playgroud) 更新:我尝试将时间线上的策略设置为.atEnd,因为只有一个条目。这没有任何区别。我已经尝试在 RSS 解析器文件和 AppDelegate 中运行 WidgetCenterreloadAllTimeLines方法,但它也没有做任何事情。这让我发疯了,我将不得不使用开发人员支持票来解决这个问题。
我正在慢慢为 iOS 14 的某些功能准备好我的应用程序,但不断遇到一个又一个错误,或者(更有可能)我没有正确地做事。我正在尽我所能让小部件更新,但它不会。小部件本身很简单;它显示来自 RSS 提要的最新条目的标题和一些文本。我构建了一个 XMLParser,此代码针对时间线运行:
struct Provider: TimelineProvider {
@State private var rssItems:[RSSItem]?
let feedParser = FeedParser()
func placeholder(in context: Context) -> SimpleEntry {
SimpleEntry(date: Date(), title:"News", description: "News article here", link: "Http://link", pubDate: "The day it posted")
}
func getSnapshot(in context: Context, completion: @escaping (SimpleEntry) -> ()) {
let entry = SimpleEntry(date: Date(), title:"News", description: "News Article Here", link: "Http://link", pubDate: "The day it posted")
completion(entry)
} …Run Code Online (Sandbox Code Playgroud) 在iOS 6上,我已经能够设置AVAudioSession来播放mp3文件.在iOS 7下使用Base设置运行时,这不再有效.任何想法为什么这不起作用?该应用程序永远不会崩溃...它只是不播放MP3.我已经验证了相同的代码和相同的URL适用于iOS 6应用程序.
错误是:
ERROR: 185: Error creating aggregate audio device: 'what'
WARNING: 219: The input device is 0x31; 'AppleHDAEngineInput:1B,0,1,0:1'
WARNING: 223: The output device is 0x28; 'AppleHDAEngineOutput:1B,0,1,1:0'
ERROR: 398: error 'what'
_itemFailedToPlayToEnd: {
kind = 1;
new = 2;
old = 0;
}
Run Code Online (Sandbox Code Playgroud)
代码:
- (void)viewDidLoad {
AVAudioSession *audioSession = [AVAudioSession sharedInstance];
NSError *setCategoryError = nil;
[audioSession setCategory:AVAudioSessionCategoryPlayback error:&setCategoryError];
if (setCategoryError) { /* handle the error condition */ }
NSError *activationError = nil;
[audioSession setActive:YES error:&activationError];
if (activationError) …Run Code Online (Sandbox Code Playgroud) 我希望开发一些可以在我的业务中利用iBeacon的应用程序,但需要首先知道我需要的所有硬件以及我可以从中获取它来利用它.