Posts by Paulo Rodrigues • 6,280 points
201 posts
-
1
votes1
answer65
viewsA: Error returning in getView method
Try to instantiate the Fragment so, instead of just giving a new: return Fragment.instantiate(context, Teste.class.getName()) In his Activity, the context is the this, if you do not have this…
-
4
votes1
answer563
viewsA: How do I know when the app quits on iOS?
There is no way to determine if an application has been uninstalled from the system. But there is a feedback service that is intended to inform about failures in sending notifications, ie when it…
-
2
votes1
answer305
viewsA: Query based on relationship, using Nspredicate in Core Data
Simply use the names of the properties, both of the entity and of the relationship in the condition of the NSPredicate to make the request. Swift: let request = NSFetchRequest(entityName: "Filho")…
-
1
votes1
answer148
viewsA: How to control the lines between the main Uitableview and the Uitableview of the Uisearchbar?
Your flag isFiltrado, if it is working correctly, it can be used for checking in all table methods, for example: numberOfRowsInSection, cellForRowAtIndexPath and didSelectRowAtIndexPath. Then, you…
-
1
votes1
answer63
viewsA: How to use Uisearchbar with data from Core Data?
Apparently according to the error, in arrayAtividadeLocal you have a vector of objects from Core Data, that’s right? Therefore, you need to iterate considering this object and not one Nsdictionary,…
-
1
votes2
answers244
viewsA: How to make a Uitableviewcell work like Facebook Messenger for iOS?
In a slightly simpler way, considering that you have some way to persist this data, you can do something like this in the method cellForRowAtIndexPath: of your table: if ([objPessoa isSaved]) {…
-
3
votes2
answers2136
viewsA: How to use a Bundle with an uncivilized type?
You can go directly to Intent, doing so you need to add an implementation to your class Telefone: public class Telefone implements Serializable And then: intent.putExtra("telefone", telefone); In…
androidanswered Paulo Rodrigues 6,280 -
1
votes1
answer113
viewsA: How do you request Core Data to get only one attribute?
To get only the column age you define the method setPropertiesToFetch: of your object NSFetchRequest, something like that: [request setPropertiesToFetch:[NSArray arrayWithObjects:@"idade", nil]];…
-
2
votes1
answer390
viewsA: Generate package for publication in Apple Store
To develop and test your Phonegap in fact it is not necessary a Mac. All this process you can find on the internet itself in several articles. By your doubt, I believe that this step you have…
-
2
votes2
answers1338
viewsA: How to get id of an Imageview on android?
I’m assuming your intention is to get an integer referencing your image, but that’s not really what happens when you use the method setImageResource. You can check in ImageView#setImageResource()…
-
1
votes1
answer162
viewsA: use Viewpager to increment variable
Well, what I did very quickly here was totally based on example that I pointed out to you in the comment. So, to simplify, I suggest following the beginning of the example in which he mounts the…
androidanswered Paulo Rodrigues 6,280 -
1
votes1
answer77
viewsA: How to take parameter from inside the popup?
The method getText() returns a Editable and there is no equivalent parameter for String.valueOf(). To get the string from Edittext, do so: valor = etpage.getText().toString()…
-
3
votes1
answer503
viewsA: changed the background of the button and stopped the action effect
You need a selector in that background to have button states, not simply a solid color. Create a file btn_selector.xml in your directory drawable and do something like that: <selector…
-
1
votes1
answer130
viewsA: How to send Activity values to webview Cordova?
Once you’ve owned your WebView in action, you can execute a method Javascript inside her like this: webView.loadUrl("javascript:foo('" + bar + "')"); And within the index.html has the implementation…
-
1
votes1
answer238
viewsA: Validate Objective-C field
Using only regular expression, you can have a method like this: - (BOOL)validarCampo { NSString *string = [self.campoQualquer text]; NSRange range = [string rangeOfString:@"^\\d{6}(SP|MG|RJ)$"…
-
2
votes3
answers2723
viewsA: Domain without www does not work
Also using the .htaccess, if you do not have access to the Virtual Host, you may have something like this at the root of your domain: <IfModule mod_rewrite.c> RewriteEngine on RewriteCond…
-
0
votes2
answers89
viewsA: How to order Contacts by name?
Using the last parameter in query, change your Cursor for something like this: Cursor cursor = getContentResolver.query(simUri, null, null, null, "name ASC");…
-
2
votes1
answer1046
viewsA: How to work securely on an Android+API?
One of the additional implementations you can use is authentication HTTP, so the user will be asked to enter a username and password, wherever he accesses your API. I usually do this using the files…
-
2
votes1
answer407
viewsA: How to add characters to a native iOS keyboard type?
There is an option on UITextField with keyboard for numbers and scores, but it is the whole keyboard, just change the initial view as soon as it is displayed. Anyway, you can use a validation in the…
-
7
votes6
answers11785
viewsA: Is there an advantage to using filter_input instead of isset?
Yes, and a lot of advantage, since with it you "clean" the input data when using the third parameter, which is the filter type. There are several filters that you can replace with manual validations…
phpanswered Paulo Rodrigues 6,280 -
2
votes1
answer89
viewsA: Load Uiviewcontroller
You can’t add one UIViewController as subview other’s UIView. For that purpose, there is the Custom Container. Then you can add through the method addChildViewController:childController in his…
-
4
votes2
answers103
viewsA: How to customize Uialertview?
To customize a UIAlertView, this being a UIView any, you could simply create a subclass of this and make the changes you want, even overriding the layoutSubviews:, as shown in that tutorial. And why…
-
0
votes2
answers416
viewsA: Webview on Ios goes blank
After creating the view in his Storyboard and the archives Viewcontroller, you make a bond between these two, there at Storyboard, select the bar Utilities > Identity inspector and inform the…
-
2
votes1
answer79
viewsA: Determine content to fill Uitableview based on a Uibutton tag
Well like you said, you don’t even have to have several controllers for each different content. Let’s assume you have these buttons: @property (nonatomic, weak) IBOutlet UIButton *btnRestaurantes;…
-
4
votes2
answers103
viewsA: How to replace a keyboard with a Uipickerview?
Just add your own UIPickerView on the property inputView of UITextField. Supposing you have something like that when you start your View Controller: _picker = [[UIPickerView alloc]…
-
3
votes2
answers313
viewsA: How to set up cronjobs in cakephp?
Ideally you do this in your layer of Model, I think you should rethink this option of calling directly from Controller. For this, you must first create a task shell, which will be executed on your…
-
1
votes1
answer72
viewsQ: Filter with Nspredicate with inheritance
I have a structure in Core Data thus: Cliente --- id = inteiro --- dados = Pessoa Pessoa --- nome = string PessoaFisica < Pessoa --- cpf = string PessoaJuridica < Pessoa --- cnpj = string How…
-
4
votes1
answer175
viewsA: Listactivity does not work Android
The code Java is case-sensitive, that means that Double is different from double, String is different string and so on. Therefore, you have an error in your code since the method Oncreate does not…
-
6
votes1
answer2392
viewsA: Generate private certificate APK using Eclipse Android
I use the Android ADT Bundle, but I believe it is the same place if you are using Eclipse with the ADT plugin separately. Go to the menu ADT (or Eclipse) and then open the Preferences. In the option…
-
2
votes4
answers10133
viewsA: Develop iOS apps using Java
In the eyes of Apple, you can only use the Xcode in his Mac, developing with Objective-C or Swift. I say this because otherwise than this, in a way goes against company principles. You can find…
-
2
votes1
answer196
viewsA: Cakeemail sends email without message
Note that by documentation, you need to set the template at the time you create the settings, and currently you use the template default, that not the same as you created and showed in your…
-
2
votes2
answers3645
viewsA: How to pass data from an Sqlite table to several Edittext fields
It seems you have an error in the return of your method listarConfiguracoes(), that should actually return to your list that was filled in. return listaConfiguracoes; To display the data in your…
-
1
votes1
answer100
viewsA: How to change the required minimum password size
To change the minimum size, do so in your validation variable: 'password' => 'required|min:8' More details you can check on documentation.…
laravelanswered Paulo Rodrigues 6,280 -
2
votes1
answer107
viewsA: Check if a device has GPS and Location Service is active
Using the class CLLocationManager you can use the method locationServicesEnabled, that a value is returned BOOL. if (![CLLocationManager locationServicesEnabled]) { // Localização não habilitada } I…
-
1
votes1
answer206
viewsA: Recording Plist on Device
You need to create this file at runtime in the directory Documents, which is where your app has write permission as well, as this is the default concept of the app on iOS, running in an environment…
-
1
votes1
answer519
viewsA: Invalid argument supplied for foreach()
Its variable $validate is declaring the arrays incorrectly. Do so so: var $validate = array( 'path' => array( 'rule' => array( 'allowEmpty' => true, 'extension' => array('gif', 'jpeg',…
-
3
votes1
answer331
viewsA: How to pass information from the second Viewcontroller to the first Viewcontroller
The direction you should take is just the one you found, through protocol. It’s quite simple and it’s independent if it’s TableViewController or not. Let’s assume you have the PrimeiraViewController…
-
3
votes1
answer564
viewsA: Is there an easier way to textfield phone?
I have something generic, which also works with phone, using mask. So, I have a subclass of UITextField who I called CustomTextField. My file .h is more or less like this: @interface CustomTextField…
objective-canswered Paulo Rodrigues 6,280 -
1
votes1
answer59
viewsA: Does postLink method not exist in Cakephp version 2.4.4?
In fact you are using the helper wrong. The correct is the FormHelper and not the HtmlHelper. As you can see in API and in the documentation.…
-
5
votes6
answers11304
viewsA: How to get distance given the coordinates using SQL?
In Mysql, I have something like that (not using functions), passing by -19.83996, -43.94910, for example: 6371 * acos(cos(radians(-19.83996)) * cos(radians(lat)) * cos(radians(-43.94910) -…
-
6
votes2
answers395
viewsA: Format number in Objective-C
Using %g to define accuracy, do something like this: float num1 = 2.00; float num2 = 2.34; NSLog(@"%g, %g", num1, num2); Exit: 2, 2.34…
objective-canswered Paulo Rodrigues 6,280 -
3
votes4
answers1447
viewsA: Format currency in a Uitextfield
I have something a little different on shouldChangeCharactersInRange in an application of mine working the way you want. - (BOOL)textField:(UITextField *)textField…
-
4
votes2
answers250
viewsA: Googlemapsv2 to work in production version
Using the Eclipse IDE, you can generate the hash the moment you export your project to an APK by accessing File > Export, selecting Export Android Application and on the screen following your…
-
13
votes8
answers7818
viewsA: Check if variable contains a well formatted PHP email address
An option is also using filter_var(): function valida_email($email) { return filter_var($email, FILTER_VALIDATE_EMAIL); }…
-
0
votes4
answers1914
viewsA: Check if a file exists on the remote machine via FTP in PHP
How about with ftp_nlist? $contents = ftp_nlist($id_ligacao, "public_html"); if (in_array($ficheiro, $contents)) { // existe } else { // não existe }…
-
2
votes1
answer985
viewsA: Dynamically add layouts
I’m guessing this XML you quoted is what you’re wanting to add on your screen dynamically, right? So you will get this View, assuming it is the layout qualquer.xml, thus: View view =…
-
1
votes2
answers1228
viewsA: Using Ajax in Cakephp 2.0
There is not much secret, that is the path you are following using the Jshelper. First you need to include the helper in his Controller: public $helpers = array('Js' => array('Jquery')); And to…
-
10
votes2
answers2940
viewsA: Draw path on the map
I have something more or less like this: a class Gmapv2direction.java with the method getDocument, that will make me the consultation to Google Maps API to directions and returns me the XML, besides…
-
0
votes3
answers845
viewsA: How to view alphabetically - Cakephp
Just add the parameter order: $bairros = $this->Bairro->find('list', array('order' => array('Bairro.bairro ASC'), 'fields' => array('id','bairro'), 'conditions' => array('cidade'…
-
3
votes5
answers16269
viewsA: How to enable a button only when all inputs are completed?
Try something like this, for example: $(document).ready(function (){ validate(); $('#nome, #email, #telefone').change(validate); }); function validate(){ if ($('#nome').val().length > 0…