小编Jam*_*LCQ的帖子

检测UITextView滚动位置

我正在尝试实现一个条款和条件页面的形式,其中"继续"按钮仅在用户滚动到UITextView的底部时启用.到目前为止,我已将我的类设置为UIScrollView委托并已实现以下方法:

- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView
{
    NSLog(@"Checking if at bottom of UITextView");
    CGPoint bottomOffset = CGPointMake(0,self.warningTextView.frame.size.height);
    //if ([[self.warningTextView contentOffset] isEqualTO:bottomOffset])
    {
    }    
}
Run Code Online (Sandbox Code Playgroud)

我已经评论了if语句,因为我不确定如何检查UITextView是否位于底部.

cocoa uitextview uitextviewdelegate ios

10
推荐指数
2
解决办法
6250
查看次数

使用Chaining克服Cloud Code Parse Limit 1000?

我有以下功能,我用它来确定记分板中的用户排名.

Parse.Cloud.define("getUserGlobalRank", function(request, response) 
{
    var usernameString = request.params.username;
    var scoreAmount = request.params.score;

    var globalRankQuery = new Parse.Query("scoreDB");
        globalRankQuery.greaterThanOrEqualTo("score",scoreAmount);  
        globalRankQuery.descending("score");
        globalRankQuery.limit("1000");
        globalRankQuery.count(
        {
        success: function(count);
        {
            response.success(count);                
        },
Run Code Online (Sandbox Code Playgroud)

.........

但是,如果有超过1000个符合该条件的条目,则不会给出准确的响应.我想将一组.find方法链接在一起,然后我可以执行.count.有谁知道我怎么能做到这一点?如果你能提供一个很棒的代码示例!

非常感谢,詹姆斯

javascript parse-platform

5
推荐指数
2
解决办法
7095
查看次数

AppDelegate.m类中的@interface错误

应该是一个我想念的简单解决方案.我有一个Tab View Controller驱动的应用程序,我想在用户启动或打开应用程序时通过密码保护.我在IB中创建了一个密码类和视图控制器.

我正在尝试使用AppDelegate.m类applicationDidLoadInForeground方法,并使用以下代码:

- (void)applicationWillEnterForeground:(UIApplication *)application
{
    NSUserDefaults *submissionDefaults = [NSUserDefaults standardUserDefaults];
    if ([submissionDefaults boolForKey:@"passcodeActive"] == true)
    {   
        PINAuthViewController *pinController = [[PINAuthViewController alloc] init];
        [self presentViewController:pinController animated:YES completion:nil];
    }
}
Run Code Online (Sandbox Code Playgroud)

我已经在标头中导入了我的PINAuthViewController类

#import "PINAuthViewController.h"
Run Code Online (Sandbox Code Playgroud)

但是在编译"没有可见的@interface for'AppDelegate"声明选择器'presentViewController:animated:completion'时,我收到一个错误.

谁能告诉我我做错了什么?目的是在正确输入密码时关闭密码视图控制器.

非常感谢,詹姆斯

cocoa-touch objective-c ios appdelegate

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

应用程序未运行时是否会触发UILocalNotifications?

我似乎无法找到一个明确的线程来回答这些问题:

"当应用程序未运行时(即不在前台或后台),预定的UILocalNotification是否会触发"?

"当应用程序未运行时(即不在前台或后台)并且手机处于锁定/睡眠模式时,UILocalNotifications是否会触发?"

一些答案表明他们会像UILocalNotifications由iOS操作系统处理.有些人似乎暗示只有在应用程序在后台或前台运行时才会触发.如果手机被锁定,我无法找到有关UILocalNotifications是否有效的信息.

谢谢,詹姆斯

background-foreground ios uilocalnotification

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

Xcode错误"Duplicate Symbol"导致Apple Mach-O链接器错误

duplicate symbol _leagueTableLoaded in:
/Users/Brendan/Library/Developer/Xcode/DerivedData/2013-dbhrwzgxgwhfbqatgqpfrmqyucyu/Build/Intermediates/2013.build/Debug-iphonesimulator/2013.build/Objects-normal/i386/LTGlobalResultsViewController.o

/Users/Brendan/Library/Developer/Xcode/DerivedData/2013-dbhrwzgxgwhfbqatgqpfrmqyucyu/Build/Intermediates/2013.build/Debug-iphonesimulator/2013.build/Objects-normal/i386/LTJumpToMeViewController.o

duplicate symbol _showGLobalCompany in:

/Users/Brendan/Library/Developer/Xcode/DerivedData/2013-dbhrwzgxgwhfbqatgqpfrmqyucyu/Build/Intermediates/2013.build/Debug-iphonesimulator/2013.build/Objects-normal/i386/LTGlobalResultsViewController.o

/Users/Brendan/Library/Developer/Xcode/DerivedData/2013-dbhrwzgxgwhfbqatgqpfrmqyucyu/Build/Intermediates/2013.build/Debug-iphonesimulator/2013.build/Objects-normal/i386/LTJumpToPositionViewController.o

duplicate symbol _leagueTableLoaded in:

/Users/Brendan/Library/Developer/Xcode/DerivedData/2013-dbhrwzgxgwhfbqatgqpfrmqyucyu/Build/Intermediates/2013.build/Debug-iphonesimulator/2013.build/Objects-normal/i386/LTGlobalResultsViewController.o

/Users/Brendan/Library/Developer/Xcode/DerivedData/2013-dbhrwzgxgwhfbqatgqpfrmqyucyu/Build/Intermediates/2013.build/Debug-iphonesimulator/2013.build/Objects-normal/i386/LTJumpToPositionViewController.o

ld: 3 duplicate symbols for architecture i386

clang: error: linker command failed with exit code 1 (use -v to see invocation)
Run Code Online (Sandbox Code Playgroud)

只有当我尝试在模拟器中构建时(我可以在没有错误的情况下构建的任何iOS设备上),我在xcode中收到上述错误.我有三个班:

1.LTGlobalResultsViewController 2.LTJumpToMeViewController 3.LTJumpToPositionViewController

这三个都是用xcode创建的,但是2和3都是在xcode之外修改然后重建的.

@property bool leagueTableLoaded在这三个标题中定义.它被声明为:

@property bool leagueTableLoaded;
Run Code Online (Sandbox Code Playgroud)

究竟是什么造成了这个错误?我尝试过以下方法:

  1. 我曾尝试在不同的类中重命名leagueTableLoaded,但这并没有解决它.

  2. 我尝试在library/developer/xcode文件夹中手动删除我的Derived Data文件.

  3. 根据其他问题我检查了我是否导入.m文件.不是这种情况.Apple Mach-O链接器错误("重复符号")

还有其他建议或建议吗?谢谢,詹姆斯

附加:根据要求,请查找我的.h和.m文件中引用leagueTableLoaded的所有摘录或我在尝试解决此错误时创建的任何变体:

LTJumpToMeViewController.h
@property bool leagueTableLoadedMe;

LTJumpToMeViewController.m
@implementation LTJumpToMeViewController
bool leagueTableLoaded = false;

LTGlobalResultsViewController.h
@property bool globalLeagueTableLoaded;

LTGlobalResultsViewController.m
@implementation LTGlobalResultsViewController
bool leagueTableLoaded = …
Run Code Online (Sandbox Code Playgroud)

xcode linker mach-o

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