我在iphone上安装我的应用程序时遇到一些问题,因为我不断收到以下错误消息
该服务无效
请检查您的设置,然后重试
(0XE8000022)
它一直运行得很好,直到昨天,但从昨天起我遇到了这个问题.
在创建新的Cocoa类时,如何更改Xcode创建的初始模板.
我指的是使用Xcode的新类向导时创建的注释和类名.
我有2个类,一个包括methodA,另一个包括methodB.所以在一个新类中我需要覆盖方法methodA和methodB.那么如何在目标C中实现多重继承呢?我对语法有点困惑.
我试图围绕C与Objective-C中的使用和语法的一些差异.特别是,我想知道C运算符和Objective-C中的点运算符和箭头运算符的使用方式有何不同(以及原因).这是一个简单的例子.
C代码:
// declare a pointer to a Fraction
struct Fraction *frac;
...
// reference an 'instance' variable
int n = (*frac).numerator; // these two expressions
int n = frac->numerator; // are equivalent
Run Code Online (Sandbox Code Playgroud)
Objective-C代码:
// declare a pointer to a Fraction
Fraction *frac = [[Fraction alloc] init];
...
// reference an instance variable
int n = frac.numerator; // why isn't this (*frac).numerator or frac->numerator??
Run Code Online (Sandbox Code Playgroud)
那么,看看frac两个程序中的相同情况(即它是指向Fraction对象或结构的指针),为什么它们在访问属性时使用不同的语法?特别是,在C中,numerator可以访问属性frac->numerator,但是使用Objective-C,可以使用点运算符访问它frac.numerator.既然frac是两个程序中的指针,为什么这些表达式不同?任何人都可以帮我澄清一下吗?
今天我试着在我的iPod(iOS 6.1.3)上运行我的代码,我在这里发现了一些有趣的东西......
首先,当我点击文本字段时,键盘会显示,但当我点击文本字段外的其他位置时,它不会隐藏.
所以我决定使用Google搜索并找到了这个解决方案:
_fieldEmail.delegate = self;
_fieldEmail.returnKeyType = UIReturnKeyDone;
_fieldPassword.delegate = self;
_fieldPassword.returnKeyType = UIReturnKeyDone;
_fieldRegisterName.delegate = self;
_fieldRegisterName.returnKeyType = UIReturnKeyDone;
_fieldRegisterEmail.delegate = self;
_fieldRegisterEmail.returnKeyType = UIReturnKeyDone;
_fieldRegisterPassword.delegate = self;
_fieldRegisterPassword.returnKeyType = UIReturnKeyDone;
Run Code Online (Sandbox Code Playgroud)
它有效...它在键盘底部给出一个"完成"按钮,现在可以通过按下它来隐藏键盘.
但我这里有两个问题:
这就是我需要知道的
是否可以在UITabBar中使用自定义颜色和背景图像?我意识到Apple希望每个人都使用相同的蓝色和灰色标签栏,但有没有办法自定义这个?
其次,即使我创建自己的TabBar视图控制器,以及自定义图像,这是否会违反Apple的人机界面指南?
我是Objective C和IPhone开发的新手.
我在我的IPhone应用程序中使用UIDatePicker,我的要求是允许用户仅从DatePicker中选择将来的日期.
为此,我想仅在DatePicker中禁用过去的日期和时间,而不是在代码中进行比较验证.
这是可能的还是有一个选项可以在DatePicker控件本身中禁用过去的日期.
保持"在应用程序中"的唯一方法是给他们一个paypal移动网站的UIWebView并让他们在那里完成交易,否则用户需要使用他们的API密钥.
这听起来不错,有没有人有或看过任何示例代码?我不得不认为这是一段很常见的代码.
更新:Apple会允许吗?这是一个慈善机构的应用程序,所以我假设没有问题.
重新更新:我认为错了.Apple不允许使用paypal在应用内直接付款.您必须重定向到Web界面.
当我使用此代码在UIImageView上滑动时,我正在尝试NSLog,但由于某些原因它不起作用.任何的想法 ?
@implementation ViewController
- (void)viewDidLoad
{
[super viewDidLoad];
UIImage *image = [UIImage imageNamed:@"image2.png"];
UIImageView *imageView = [[UIImageView alloc] initWithImage:image];
imageView.frame = [[UIScreen mainScreen] bounds];
[self.view addSubview:imageView];
UISwipeGestureRecognizer *recognizer = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(rightSwipeHandle:)];
[recognizer setNumberOfTouchesRequired:1];
[imageView addGestureRecognizer:recognizer];
}
- (void)rightSwipeHandle:(UISwipeGestureRecognizer*)gestureRecognizer {
NSLog(@"right swipe");
}
Run Code Online (Sandbox Code Playgroud) 我有一个UISegmentedControl4段.当它被选中时,它应该保持selected state.当再次单击相同的段时,它应该deselect itself.怎么做到这一点?
objective-c ×9
iphone ×4
ios ×3
c ×1
cocoa ×1
cocoa-touch ×1
dot-operator ×1
inheritance ×1
installation ×1
macos ×1
paypal ×1
pointers ×1
templates ×1
uibutton ×1
uidatepicker ×1
uiimageview ×1
xcode ×1
xcode4 ×1
xcode4.5 ×1