小编Cla*_*nce的帖子

仅允许用户按一次UIButton

我正在尝试设计一个应用程序的界面,我只想让用户按一次UIButton来获得结果.按下按钮后有什么办法可以锁定按钮吗?只有在按下另一个按钮时才释放锁定?

谢谢

iphone xcode ipad ios

3
推荐指数
1
解决办法
4324
查看次数

如何显示从最新到最旧排列的相册

当我使用下面的代码从iphone加载相册时,我遇到了问题.虽然我装的很完美,但第一张照片出现的却是最古老的照片.是否可以重新排列顺序,以便我可以先获取最新的照片,然后是时间,最后的是后面的照片?

- (IBAction)imageFromAlbum:(id)sender
  {    
    imagePicker = [[UIImagePickerController alloc] init];
    imagePicker.delegate = self;
    imagePicker.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum;
    [self presentViewController:imagePicker animated:YES completion:nil];
  }
Run Code Online (Sandbox Code Playgroud)

iphone xcode uiimagepickercontroller ipad ios

3
推荐指数
1
解决办法
3934
查看次数

在Swift中动画循环进度视图

我希望我的循环progressView有一个动画,下面的代码.我希望动画开始从0到我想要的值的进度.但我永远无法让动画工作.

func Popular(){
let circle = Pop;//Pop is a UIView

circle.bounds = CGRect(x: 0,y: 0, width: 100, height: 100);
circle.frame = CGRectMake(0,0, 100, 100);

circle.layoutIfNeeded()

var progressCircle = CAShapeLayer();

let centerPoint = CGPoint (x: circle.bounds.width / 2, y: circle.bounds.width / 2);
let circleRadius : CGFloat = circle.bounds.width / 2 * 0.83;

let circlePath = UIBezierPath(arcCenter: centerPoint, radius: circleRadius, startAngle: CGFloat(-0.5 * M_PI), endAngle: CGFloat(1.5 * M_PI), clockwise: true    );

progressCircle = CAShapeLayer ();
progressCircle.path = circlePath.CGPath;
progressCircle.strokeColor = UIColor.greenColor().CGColor;
progressCircle.fillColor …
Run Code Online (Sandbox Code Playgroud)

animation progress ios swift

3
推荐指数
1
解决办法
6879
查看次数

Xcode:如何转到滚动视图中的特定位置

使用图像制作长滚动视图时遇到问题.用户很难向下滚动这么长时间才能到达该图像或按钮.有没有什么方法可以在滚动视图的顶部创建一些按钮,同时按下这些按钮可以直接向下滚动到我想要的特定位置?(向下滚动动画会很好)

非常感谢.

xcode uiscrollview uiimage

2
推荐指数
1
解决办法
8719
查看次数

- [NSDictionary initWithObjects:forKeys:]:对象计数(0)与键计数不同(2)

我收到了错误

- [NSDictionary initWithObjects:forKeys:]:对象计数(0)与键计数(2)不同

这是我保存plist的代码.

    @interface setting : UIViewController{
    UIDatePicker *datePicker;
    IBOutlet UILabel * morningtime;
    UIDatePicker *afternoonpicker;
    NSString*morningtime1;
    NSString*afternoontime1;
     IBOutlet UILabel *afternoontime;
}
@property (nonatomic,retain) IBOutlet UIDatePicker *datePicker;
@property (strong, nonatomic) IBOutlet UIDatePicker *afternoonpicker;

@property (nonatomic, retain) IBOutlet NSString *morningtime1;

@property (nonatomic, retain) IBOutlet NSString *afternoontime1;
@property (nonatomic, retain) IBOutlet UILabel *morningtime;

@property (nonatomic, retain) IBOutlet UILabel *afternoontime;
@property (weak, nonatomic) IBOutlet UIButton *morning;




- (IBAction)savetext:(id)sender {
    NSArray *paths = NSSearchPathForDirectoriesInDomains (NSDocumentDirectory, NSUserDomainMask, YES);
    // get documents path
    NSString *documentsPath …
Run Code Online (Sandbox Code Playgroud)

objective-c nsdictionary plist ios

2
推荐指数
1
解决办法
8609
查看次数

选择UICollectionView

我正在按照教程进行溢出UICollectionView.此外,我想对物品进行选择,然后是新的外观UIViewController.

我可以知道如何做到这一点?我可以UITable选择选择索引= 0,1或2等吗?代码显示正确,NSLog但没有去其他UIViewController

 - (void)tapCell:(UITapGestureRecognizer *)inGestureRecognizer
{
    NSIndexPath *theIndexPath = [self.collectionView indexPathForCell:(UICollectionViewCell *)inGestureRecognizer.view];

    if (theIndexPath.row ==0) {
        NSLog(@"****");
        page *noteDetailViewControler = [[page alloc] initWithNibName:@"page" bundle:nil];    }
}
Run Code Online (Sandbox Code Playgroud)

这是完整的代码:

@implementation CDemoCollectionViewController

- (void)viewDidLoad
{
    [super viewDidLoad];

    self.cellCount = 10;
    self.imageCache = [[NSCache alloc] init];

    [self.collectionView registerNib:[UINib nibWithNibName:NSStringFromClass([CCoverflowTitleView class]) bundle:NULL] forSupplementaryViewOfKind:@"title" withReuseIdentifier:@"title"];

    NSMutableArray *theAssets = [NSMutableArray array];
    NSURL *theURL = [[[NSBundle mainBundle] resourceURL] URLByAppendingPathComponent:@"Images"];
    NSEnumerator *theEnumerator = [[NSFileManager defaultManager] enumeratorAtURL:theURL includingPropertiesForKeys:NULL options:NSDirectoryEnumerationSkipsPackageDescendants | …
Run Code Online (Sandbox Code Playgroud)

objective-c ios uicollectionview

1
推荐指数
1
解决办法
5620
查看次数

如何在文本到语音合成期间停​​止声音?

我使用以下代码使用按钮初始化文本到语音合成.但有时用户可能希望在演讲中停止发声.我可以知道有没有我可以做的代码.

谢谢

这是我的代码

@interface RMDemoStepViewController ()

@end

@implementation RMDemoStepViewController
- (void)viewDidLoad
{
    [super viewDidLoad];
    //Add Border to TextBox


    //Instantiate the object that will allow us to use text to speech
    self.speechSynthesizer = [[AVSpeechSynthesizer alloc] init];
    [self.speechSynthesizer setDelegate:self];

}
- (IBAction)speakButtonWasPressed:(id)sender{

    [self speakText:[self.textView text]];

}

- (void)speakText:(NSString *)toBeSpoken{

    AVSpeechUtterance *utt = [AVSpeechUtterance speechUtteranceWithString:toBeSpoken];
    utt.rate = [self.speedSlider value];
    [self.speechSynthesizer speakUtterance:utt];

}

- (IBAction)speechSpeedShouldChange:(id)sender
{
    UISlider *slider = (UISlider *)sender;
    NSInteger val = lround(slider.value);
    NSLog(@"%@",[NSString stringWithFormat:@"%ld",(long)val]);
}
@end
Run Code Online (Sandbox Code Playgroud)

iphone objective-c text-to-speech ios ios7

1
推荐指数
1
解决办法
3850
查看次数

无法实例化名为UIRefreshControl Xcode的类

我正在桌面视图上构建RSS提要.当我运行应用程序时,我的iPhone可以在ipad中顺利运行,它崩溃并显示"因未捕获的异常终止应用程序'NSInvalidUnarchiveOperationException',原因:'无法实例化名为UIRefreshControl的类'"

我试图在我的ipad模拟器上运行应用程序,它也可以顺利运行.我可以知道那是什么问题吗?

谢谢

xcode ipad ios6 uirefreshcontrol

0
推荐指数
2
解决办法
628
查看次数

在应用程序启动笔记应用程序

我正在制作一个应用程序,并希望有一个链接到iOS 5的笔记应用程序的功能.是否有任何代码?例如,我有一个UIButton,当用户按下它时,它会关闭应用程序并启动iOS笔记应用程序.

谢谢

iphone uibutton ipad ios

-1
推荐指数
1
解决办法
228
查看次数