小编san*_*osh的帖子

如何读取UITextView中的行数

我正在使用UITextView在我的视图中,我要求使用以下函数来计算textview am所包含的行数'\n'.但是这只有在从键盘按下返回键时才起作用,但是在线条换行器中(当我键入连续字符时,我不会获得新行字符).如何在不更改返回键的情况下更改行时读取新的字符?任何人都有任何想法如何...请分享它..我正在关注此链接 链接

- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range 
 replacementText:(NSString *)text
{
    // Any new character added is passed in as the "text" parameter
    if ([text isEqualToString:@"\n"]) {
        // Be sure to test for equality using the "isEqualToString" message
        [textView resignFirstResponder];

        // Return NO so that the final '\n' character doesn't get added
        return NO;
    }
    // For any other character return YES so that the text gets added to the view
    return YES;
}
Run Code Online (Sandbox Code Playgroud)

iphone cocoa-touch objective-c uitextview

24
推荐指数
3
解决办法
3万
查看次数

UIPickerView适用于所在国家/地区

我需要有关UIPickerView的帮助,在我的应用程序中,我必须在可用的国家/地区显示UIPickerView.如果任何机构已经实施了国家选择器,请分享代码.

谢谢

iphone ios4

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

在BlackBerry上编译错误

我为黑莓做了简单的java应用程序,同时构建我的跟踪错误.

"Building Hisantosh
C:\BlackBerryJDE4.5.0\bin\rapc.exe  -quiet import=..\lib\net_rim_api.jar codename=Hisantosh Hisantosh.rapc warnkey=0x52424200;0x52525400;0x52435200
"C:\Documents and Settings\Santosh\My Documents\Downloads\greetingscreen.java"
"C:\Documents and Settings\Santosh\My Documents\Downloads\helloworld.java"
I/O Error: Cannot run program "javac": CreateProcess error=2, The system cannot find the file specified
Error while building project "
Run Code Online (Sandbox Code Playgroud)

我已经设置了所有路径变量.

blackberry compiler-errors environment-variables java-me

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

NEHotspotHelper注释没有出现

我们尝试了新的NetworkExtension API.我们成功地重新创建了应用程序中的所有步骤.但是,我们有一个问题,我们仍然没有在Wifi设置屏幕中看到SSID名称下面的自定义注释.我们在ios 9 Beta 3,xcode 7 beta 3上.

我们已成功完成这些步骤:

  • @note 1应用程序的Info.plist必须包含一个包含'network-authentication'的UIBackgroundModes数组*.

  • @note 2*应用程序必须将'com.apple.developer.networking.HotspotHelper'*设置为其权利之一.权利的值是布尔值*值true.

这是我们在App中的代码.我们试图通过文本"试试这里"以"Internet"的名称来注释SSID.我们得到了为SSID"Internet"调用setConfidence方法的日志.但是,我们在Wifi选择屏幕中看不到实际的注释.

我们还试图为选项对象传递'nil',该对象承诺将App名称显示为默认注释.但我们也没有看到.我们得到方法registerWithOptions()的调用返回'true',当我们打开wifi设置屏幕时我们得到回调

 

NSMutableDictionary* options = [[NSMutableDictionary alloc] init]; 
[options setObject:@"Try Here" forKey:kNEHotspotHelperOptionDisplayName]; 
 dispatch_queue_t queue = dispatch_queue_create("com.myapp.ex", 0); 
BOOL returnType = [NEHotspotHelper registerWithOptions:options queue:queue 
handler: ^(NEHotspotHelperCommand * cmd) { 
    if(cmd.commandType == kNEHotspotHelperCommandTypeEvaluate || cmd.commandType == kNEHotspotHelperCommandTypeFilterScanList ) { 
         
        for (NEHotspotNetwork* network  in cmd.networkList) {  
            if ([network.SSID isEqualToString:@"Internet"]){ 
                [network setConfidence:kNEHotspotHelperConfidenceHigh];               
                NSLog(@"Confidance set to high for ssid:%@",network.SSID); 
            }  
        }    
    } 
}];
Run Code Online (Sandbox Code Playgroud)

=========================

请帮助我们了解我们缺少的是什么?

iphone objective-c ios networkextension

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

用于BlackBerry开发的IDE

我已经安装了eclipse JDE插件(即BlackBerry_JDE_PluginFull_1.0.0.67.exe),我只能为BlackBerry JDE 4.5.0创建一个黑莓项目.当我在窗口中看到 - >首选项 - >黑莓 - >安装了eclipse的组件时,黑莓JDE组件包4.5.0可用,如果我想要有多个JDE应该做什么.是否有除Eclipse之外的任何IDE都是用于BlackBerry Developement.

netbeans eclipse-plugin blackberry jde

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