当点击地址簿中的任何联系人(在我的应用程序内)时,它在iOS 10测试版上崩溃并在iOS 9版本上运行良好;
这是崩溃日志
*** Terminating app due to uncaught exception 'CNPropertyNotFetchedException', reason: 'A property was not requested when contact was fetched.'
*** First throw call stack:
(0x1cf11a07 0x1c62af63 0x1cf1194d 0x246f0f4f 0x246c6a71 0x1ce355eb 0x1ce2e19b 0x246c69cf 0x246c6883 0x25e4a375 0x2538f283 0x254204ef 0x25420bb1 0xe9da97 0xe9da83 0xea2321 0x1cecf18f 0x1cecd477 0x1ce1e6bd 0x1ce1e549 0x1e54ebfd 0x21f961e3 0x21f90947 0x966c9 0x1ca9e507)
libc++abi.dylib: terminating with uncaught exception of type NSException
Run Code Online (Sandbox Code Playgroud)
以下是在我的应用程序中打开地址簿的代码:
-(void)showContactPicker {
__weak RecieverSelectorViewController *weakSelf = self;
ABPeoplePickerNavigationController* picker = [[ABPeoplePickerNavigationController alloc] init];
picker.peoplePickerDelegate = self;
picker.modalPresentationStyle = UIModalPresentationFullScreen; …
Run Code Online (Sandbox Code Playgroud) 我有一个jquery方法,我使用单击按钮调用该方法.所以在那个代码中我有一行" $("#loadingMessage").css('padding-top','6%');
"我需要这行只在我们第一次调用该方法时执行一次,之后我就离开了这一行.
所以请帮助我找到一种方法
整个方法脚本如下
$('#SearchButton').click(function() {
$(".spinner").css('visibility','hidden');
$("#loadingMessage").css('padding-top','6%'); //I want this line execute only once, i mean first time
loaderStart();
document.getElementById('loadinggif3').style.display = "block";
$("#loadinggif3").show();
$(".col-sm-9").css('visibility','hidden');
var str = $('#SearchText').val();
str = str.trim();
if(str=="") return false;
)};
Run Code Online (Sandbox Code Playgroud) 在我的应用程序中,我想检查当前时间是在变量中保存的时间之前还是之后.
就像我的时间1 time1=@"08:15:12";
和我的 时间2time2=@"18:12:8";
所以我想在time1和time2之间进行比较.目前这些变量都是NSString格式.
以下是用于获取时间的代码,我不知道如何比较它们.
码:
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
dateFormatter.dateFormat = @"HH:MM:SS";
[dateFormatter setTimeZone:[NSTimeZone systemTimeZone]];
NSLog(@"ewetwet%@",[dateFormatter stringFromDate:now]);
Run Code Online (Sandbox Code Playgroud)
请帮我
您好我试图在我的iOS应用程序中集成谷歌分析.但它不起作用,当我打开分析仪表板时它显示实时用户0,实际上它总是显示为零.
以下是我到目前为止所做的步骤
1.下载适用于iOS的Google AnalyticsSDK.
然后我就跟着这个developer.google.com链接 链接
这些是我的代码.
in appdelegate.h
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
//analytics
// Optional: automatically send uncaught exceptions to Google Analytics.
[GAI sharedInstance].trackUncaughtExceptions = YES;
// Optional: set Google Analytics dispatch interval to e.g. 20 seconds.
[GAI sharedInstance].dispatchInterval = 20;
// Optional: set Logger to VERBOSE for debug information.
[[[GAI sharedInstance] logger] setLogLevel:kGAILogLevelVerbose];
// Initialize tracker.
id<GAITracker> tracker = [[GAI sharedInstance] trackerWithTrackingId:@"UA-********-*"];
return YES;
}
in my viewcontroller.h file
#import "GAITrackedViewController.h"
#import <UIKit/UIKit.h>
@interface TopNewsViewController : …
Run Code Online (Sandbox Code Playgroud) 您好我正在尝试创建一个简单的空白html页面与旋转器在中心.例如在该图像中的东西.
我的应用程序之前工作正常,然后我添加了admob framework
,现在它崩溃了.
请检查崩溃日志,
我曾在谷歌尝试但没有关于这次崩溃的结果.
如果我评论内部的内容viewDidAppear()
然后应用程序正在工作(不加载应用程序部分).但如果我试图加载"admob"然后崩溃.
-(void)viewDidAppear:(BOOL)animated{
if([Connectivity hasConnectivity]){
// [self loadAds];
NSTimer* myTimer = [NSTimer scheduledTimerWithTimeInterval: 15.0 target: self
selector: @selector(callAfterSixtySecond:) userInfo: nil repeats: YES];
}
}
-(void) callAfterSixtySecond:(NSTimer*) t
{
if([GMMConnectivity hasConnectivity]){
[self.adBanner removeFromSuperview];
[self loadAdmob];
}
}
-(void)loadAdmob{
CGPoint origin;
if(IS_RETINA){
if([[UIScreen mainScreen] bounds].size.height >500){
// NSLog(@"5");
origin = CGPointMake(0.0,
568-
CGSizeFromGADAdSize(kGADAdSizeSmartBannerPortrait).height);
}else{
// NSLog(@"4");
origin = CGPointMake(0.0,
(480)-
CGSizeFromGADAdSize(kGADAdSizeSmartBannerPortrait).height);
}
}else{
// NSLog(@"3");
origin = CGPointMake(0.0,
(460)-
CGSizeFromGADAdSize(kGADAdSizeSmartBannerPortrait).height);
}
// Use predefined …
Run Code Online (Sandbox Code Playgroud) 嗨,
我UITableView
在课堂上有一个,当我尝试加载内容时,出现了这样的屏幕
白框下方无法看到水平分隔线,请帮助我。
我的代码:
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return 1; //count of section
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return [names count]; //count number of row from counting array hear cataGorry is An Array
}
- (UITableViewCell *)tableView:(UITableView *)tableView
cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *MyIdentifier = @"service";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:MyIdentifier];
if (cell == nil)
{
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault
reuseIdentifier:MyIdentifier]
;
}
// Here we use the provided setImageWithURL: method to load the web image …
Run Code Online (Sandbox Code Playgroud) 嗨,我有一个基于xib的项目,然后我添加了故事板"main.storyboard".但它仍然运行与初始屏幕替代故事板相同的xib.
2013-12-18 16:44:14.376 AePubReader[1882:60b] NSMainNibFile and UIMainStoryboardFile are both set. NSMainNibFile ignored.
2013-12-18 16:44:14.396 AePubReader[1882:60b] There is no app delegate set. An app delegate class must be specified to use a main storyboard file.
Run Code Online (Sandbox Code Playgroud)
以下图片确保我已将故事板作为起始屏幕.
我的旧app app for xib文件,现在我从这里替换xib uiviewcontroller类并把我的新storyboard viewcontroller类名
.h文件
#import <UIKit/UIKit.h>
@class viewViewController;
@interface AePubReaderAppDelegate : NSObject <UIApplicationDelegate> {
UIWindow *window;
viewViewController *detailViewController;
}
@property (nonatomic, retain) IBOutlet UIWindow *window;
@property (nonatomic, retain) IBOutlet viewViewController *detailViewController;
@end
Run Code Online (Sandbox Code Playgroud)
.m文件
#import "AePubReaderAppDelegate.h"
#import "ViewController.h"
@implementation AePubReaderAppDelegate
@synthesize window, detailViewController; …
Run Code Online (Sandbox Code Playgroud) 嗨iam工作一个cordova ios项目,我有一个画廊页面.目前图像是垂直滚动的,我可以看到滚动条(如图所示).但我需要隐藏右侧的滚动条,这可能吗?
来自关注json
details = (
(
{
subtitle = "One";
title = 1;
},
{
subtitle = "two";
title = "2";
},
{
subtitle = "three";
title = "3";
}
),
(
{
subtitle = "one_two";
title = "1_2";
},
{
subtitle = "two_two";
title = "2_2";
}
)
);
Run Code Online (Sandbox Code Playgroud)
我试过跟随代码并且没有显示任何UILables
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"];
if (!cell) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell"] ;
NSUInteger row = [indexPath row];
int i …
Run Code Online (Sandbox Code Playgroud) 我有这个日期格式为"2016-03-16"的NSString,我添加了以下代码,以正确的NSDate格式获得相同的日期,但返回"2016-03-15 18:30:00 +0000".我如何在NSDate中获得相同的"2016-03-16"?
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
dateFormatter.dateFormat = @"yyyy-MM-dd";
NSString *datePart = [dateFormatter stringFromDate:dateFromString];//2016-03-16
NSDate *dateValue = [dateFormatter dateFromString:datePart];
NSLog(@"%@----",dateValue); //" 2016-03-15 18:30:00 +0000
Run Code Online (Sandbox Code Playgroud) 我试图从a中删除第一个元素NSMutableArray
并且它不起作用
arrayforDistrits= [DistrictarrayForScroll removeObjectAtIndex:0];
Run Code Online (Sandbox Code Playgroud)
这里" DistrictarrayForScroll
"和" arrayforDistrits
"是NSMutableArray
和
它显示以下错误.请检查我附加的图像.